[ros-diffs] [jmorlan] 37155: ReadBatchLine: Add a \n to the line if it doesn't already have one

jmorlan at svn.reactos.org jmorlan at svn.reactos.org
Sun Nov 2 22:56:35 CET 2008


Author: jmorlan
Date: Sun Nov  2 15:56:34 2008
New Revision: 37155

URL: http://svn.reactos.org/svn/reactos?rev=37155&view=rev
Log:
ReadBatchLine: Add a \n to the line if it doesn't already have one

Modified:
    trunk/reactos/base/shell/cmd/batch.c

Modified: trunk/reactos/base/shell/cmd/batch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/batch.c?rev=37155&r1=37154&r2=37155&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/batch.c [iso-8859-1] (original)
+++ trunk/reactos/base/shell/cmd/batch.c [iso-8859-1] Sun Nov  2 15:56:34 2008
@@ -427,7 +427,7 @@
 			return textline;
 		}
 
-		if (!FileGetString (bc->hBatchFile, textline, sizeof (textline) / sizeof (textline[0])))
+		if (!FileGetString (bc->hBatchFile, textline, sizeof (textline) / sizeof (textline[0]) - 1))
 		{
 			TRACE ("ReadBatchLine(): Reached EOF!\n");
 			/* End of file.... */
@@ -439,6 +439,9 @@
 			continue;
 		}
 		TRACE ("ReadBatchLine(): textline: \'%s\'\n", debugstr_aw(textline));
+
+		if (textline[_tcslen(textline) - 1] != _T('\n'))
+			_tcscat(textline, _T("\n"));
 
 		first = textline;
 



More information about the Ros-diffs mailing list