Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1e538933
Commit
1e538933
authored
Apr 01, 2002
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 01, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed writing multiline block while wrapping enabled.
Fixed startup information reading (console size).
parent
3c070225
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
19 deletions
+32
-19
console.c
win32/console.c
+32
-19
No files found.
win32/console.c
View file @
1e538933
...
...
@@ -225,7 +225,7 @@ BOOL WINAPI AllocConsole(void)
SetStdHandle
(
STD_ERROR_HANDLE
,
handle_err
);
GetStartupInfoW
(
&
si
);
if
(
si
.
dwFlags
&
STARTF_USE
SIZE
)
if
(
si
.
dwFlags
&
STARTF_USE
COUNTCHARS
)
{
COORD
c
;
c
.
X
=
si
.
dwXCountChars
;
...
...
@@ -866,36 +866,49 @@ static int next_line(HANDLE hCon, CONSOLE_SCREEN_BUFFER_INFO* csbi)
* write_block
*
* WriteConsoleOutput helper: writes a block of non special characters
* Block can spread on several lines, and wrapping, if needed, is
* handled
*
*/
static
int
write_block
(
HANDLE
hCon
,
CONSOLE_SCREEN_BUFFER_INFO
*
csbi
,
DWORD
mode
,
LPWSTR
ptr
,
int
len
)
{
int
blk
;
/* number of chars to write on
firs
t line */
int
blk
;
/* number of chars to write on
curren
t line */
if
(
len
<=
0
)
return
1
;
blk
=
min
(
len
,
csbi
->
dwSize
.
X
-
csbi
->
dwCursorPosition
.
X
);
if
(
mode
&
ENABLE_WRAP_AT_EOL_OUTPUT
)
/* writes remaining on next line */
{
int
done
;
if
(
write_char
(
hCon
,
ptr
,
blk
,
&
csbi
->
dwCursorPosition
)
!=
blk
)
return
0
;
for
(
done
=
0
;
done
<
len
;
done
+=
blk
)
{
blk
=
min
(
len
-
done
,
csbi
->
dwSize
.
X
-
csbi
->
dwCursorPosition
.
X
);
if
(
blk
<
len
)
/* special handling for right border */
if
(
write_char
(
hCon
,
ptr
+
done
,
blk
,
&
csbi
->
dwCursorPosition
)
!=
blk
)
return
0
;
if
(
csbi
->
dwCursorPosition
.
X
==
csbi
->
dwSize
.
X
&&
!
next_line
(
hCon
,
csbi
))
return
0
;
}
}
else
{
if
(
mode
&
ENABLE_WRAP_AT_EOL_OUTPUT
)
/* writes remaining on next line */
{
if
(
!
next_line
(
hCon
,
csbi
)
||
write_char
(
hCon
,
ptr
+
blk
,
len
-
blk
,
&
csbi
->
dwCursorPosition
)
!=
len
-
blk
)
return
0
;
}
else
/* all remaining chars should be written on last column, so only write the last one */
{
csbi
->
dwCursorPosition
.
X
=
csbi
->
dwSize
.
X
-
1
;
if
(
write_char
(
hCon
,
ptr
+
len
-
1
,
1
,
&
csbi
->
dwCursorPosition
)
!=
1
)
return
0
;
csbi
->
dwCursorPosition
.
X
=
csbi
->
dwSize
.
X
-
1
;
}
blk
=
min
(
len
,
csbi
->
dwSize
.
X
-
csbi
->
dwCursorPosition
.
X
);
if
(
write_char
(
hCon
,
ptr
,
blk
,
&
csbi
->
dwCursorPosition
)
!=
blk
)
return
0
;
if
(
blk
<
len
)
{
csbi
->
dwCursorPosition
.
X
=
csbi
->
dwSize
.
X
-
1
;
/* all remaining chars should be written on last column,
* so only overwrite the last column with last char in block
*/
if
(
write_char
(
hCon
,
ptr
+
len
-
1
,
1
,
&
csbi
->
dwCursorPosition
)
!=
1
)
return
0
;
csbi
->
dwCursorPosition
.
X
=
csbi
->
dwSize
.
X
-
1
;
}
}
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment