=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd: Improve WCMD_fgets documentation.

Alexandre Julliard julliard at winehq.org
Mon Oct 3 17:21:24 CDT 2011


Module: wine
Branch: master
Commit: e3a72698c1ea89f0b6a0d4c1459c339c5a2ed8a6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e3a72698c1ea89f0b6a0d4c1459c339c5a2ed8a6

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Sat Oct  1 13:43:17 2011 +0200

cmd: Improve WCMD_fgets documentation.

---

 programs/cmd/batch.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/programs/cmd/batch.c b/programs/cmd/batch.c
index 447eccd..52dd08e 100644
--- a/programs/cmd/batch.c
+++ b/programs/cmd/batch.c
@@ -176,9 +176,14 @@ WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end) {
 /****************************************************************************
  * WCMD_fgets
  *
- * Get one line from a batch file/console. 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.
+ * Gets one line from a file/console and puts it into buffer s
+ * Pre:  s 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
+ * Returns:
+ *       s on success
+ *       NULL on error or EOF
  */
 
 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;
   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;
   if (is_console_handle) {
     status = ReadConsoleW(h, s, noChars, &charsRead, NULL);




More information about the wine-cvs mailing list