Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
d25f614c
Commit
d25f614c
authored
Oct 05, 2011
by
Frédéric Delanoy
Committed by
Alexandre Julliard
Oct 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Rename a parameter in WCMD_fgets.
parent
63e11558
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
batch.c
programs/cmd/batch.c
+17
-17
wcmd.h
programs/cmd/wcmd.h
+1
-1
No files found.
programs/cmd/batch.c
View file @
d25f614c
...
...
@@ -176,17 +176,17 @@ WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end) {
/****************************************************************************
* WCMD_fgets
*
* Gets one line from a file/console and puts it into buffer
s
* Pre:
s
has size noChars
* Gets one line from a file/console and puts it into buffer
buf
* Pre:
buf
has size noChars
* 1 <= noChars <= MAXSTRING
* Post:
s
is filled with at most noChars-1 characters, and gets nul-terminated
s
does not include EOL terminator
* Post:
buf
is filled with at most noChars-1 characters, and gets nul-terminated
buf
does not include EOL terminator
* Returns:
*
s
on success
*
buf
on success
* NULL on error or EOF
*/
WCHAR
*
WCMD_fgets
(
WCHAR
*
s
,
int
noChars
,
HANDLE
h
,
BOOL
is_console_handle
)
WCHAR
*
WCMD_fgets
(
WCHAR
*
buf
,
int
noChars
,
HANDLE
h
,
const
BOOL
is_console_handle
)
{
DWORD
bytes
,
charsRead
;
BOOL
status
;
...
...
@@ -195,29 +195,29 @@ WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
/* We can't use the native f* functions because of the filename syntax differences
between DOS and Unix. Also need to lose the LF (or CRLF) from the line. */
p
=
s
;
p
=
buf
;
if
(
is_console_handle
)
{
status
=
ReadConsoleW
(
h
,
s
,
noChars
,
&
charsRead
,
NULL
);
status
=
ReadConsoleW
(
h
,
buf
,
noChars
,
&
charsRead
,
NULL
);
if
(
!
status
)
return
NULL
;
if
(
s
[
charsRead
-
2
]
==
'\r'
)
s
[
charsRead
-
2
]
=
'\0'
;
/* Strip \r\n */
if
(
buf
[
charsRead
-
2
]
==
'\r'
)
buf
[
charsRead
-
2
]
=
'\0'
;
/* Strip \r\n */
else
{
/* Truncate */
s
[
noChars
-
1
]
=
'\0'
;
buf
[
noChars
-
1
]
=
'\0'
;
}
return
p
;
}
/* TODO: More intelligent buffering for reading lines from files */
do
{
status
=
WCMD_ReadFile
(
h
,
s
,
1
,
&
bytes
);
if
((
status
==
0
)
||
((
bytes
==
0
)
&&
(
s
==
p
)))
return
NULL
;
if
(
*
s
==
'\n'
)
bytes
=
0
;
else
if
(
*
s
!=
'\r'
)
{
s
++
;
status
=
WCMD_ReadFile
(
h
,
buf
,
1
,
&
bytes
);
if
((
status
==
0
)
||
((
bytes
==
0
)
&&
(
buf
==
p
)))
return
NULL
;
if
(
*
buf
==
'\n'
)
bytes
=
0
;
else
if
(
*
buf
!=
'\r'
)
{
buf
++
;
noChars
--
;
}
*
s
=
'\0'
;
*
buf
=
'\0'
;
}
while
((
bytes
==
1
)
&&
(
noChars
>
1
));
return
p
;
}
...
...
programs/cmd/wcmd.h
View file @
d25f614c
...
...
@@ -97,7 +97,7 @@ void WCMD_verify (const WCHAR *command);
void
WCMD_version
(
void
);
int
WCMD_volume
(
BOOL
set_label
,
const
WCHAR
*
command
);
WCHAR
*
WCMD_fgets
(
WCHAR
*
s
,
int
n
,
HANDLE
stream
,
const
BOOL
is_console_handle
);
WCHAR
*
WCMD_fgets
(
WCHAR
*
buf
,
int
n
,
HANDLE
stream
,
const
BOOL
is_console_handle
);
WCHAR
*
WCMD_parameter
(
WCHAR
*
s
,
int
n
,
WCHAR
**
where
,
WCHAR
**
end
);
WCHAR
*
WCMD_skip_leading_spaces
(
WCHAR
*
string
);
BOOL
WCMD_keyword_ws_found
(
const
WCHAR
*
keyword
,
int
len
,
const
WCHAR
*
ptr
);
...
...
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