cmd: Improve WCMD_fgets documentation.
This commit is contained in:
parent
aee397a317
commit
e3a72698c1
|
@ -176,9 +176,14 @@ WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end) {
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* WCMD_fgets
|
* WCMD_fgets
|
||||||
*
|
*
|
||||||
* Get one line from a batch file/console. We can't use the native f* functions because
|
* Gets one line from a file/console and puts it into buffer s
|
||||||
* of the filename syntax differences between DOS and Unix. Also need to lose
|
* Pre: s has size noChars
|
||||||
* the LF (or CRLF) from the line.
|
* 1 <= noChars <= MAXSTRING
|
||||||
|
* Post: s is filled with at most noChars-1 characters, and gets nul-terminated
|
||||||
|
s does not include EOL terminator
|
||||||
|
* Returns:
|
||||||
|
* s on success
|
||||||
|
* NULL on error or EOF
|
||||||
*/
|
*/
|
||||||
|
|
||||||
WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
|
WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
|
||||||
|
@ -187,6 +192,9 @@ WCHAR *WCMD_fgets(WCHAR *s, int noChars, HANDLE h, BOOL is_console_handle)
|
||||||
BOOL status;
|
BOOL status;
|
||||||
WCHAR *p;
|
WCHAR *p;
|
||||||
|
|
||||||
|
/* 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 = s;
|
||||||
if (is_console_handle) {
|
if (is_console_handle) {
|
||||||
status = ReadConsoleW(h, s, noChars, &charsRead, NULL);
|
status = ReadConsoleW(h, s, noChars, &charsRead, NULL);
|
||||||
|
|
Loading…
Reference in New Issue