ReadBatchLine: Add a \n to the line if it doesn't already have one

svn path=/trunk/; revision=37155
This commit is contained in:
Jeffrey Morlan 2008-11-02 21:56:34 +00:00
parent ae1019f232
commit e0d327a9ec

View file

@ -427,7 +427,7 @@ LPTSTR ReadBatchLine ()
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.... */
@ -440,6 +440,9 @@ LPTSTR ReadBatchLine ()
}
TRACE ("ReadBatchLine(): textline: \'%s\'\n", debugstr_aw(textline));
if (textline[_tcslen(textline) - 1] != _T('\n'))
_tcscat(textline, _T("\n"));
first = textline;
/* cmd block over multiple lines (..) */