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=... ============================================================================== --- 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;