From e0d327a9ecf64c2ec021b88757e7439dc2478fe0 Mon Sep 17 00:00:00 2001 From: Jeffrey Morlan Date: Sun, 2 Nov 2008 21:56:34 +0000 Subject: [PATCH] ReadBatchLine: Add a \n to the line if it doesn't already have one svn path=/trunk/; revision=37155 --- reactos/base/shell/cmd/batch.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/base/shell/cmd/batch.c b/reactos/base/shell/cmd/batch.c index 1c35123f295..ef282689b3e 100644 --- a/reactos/base/shell/cmd/batch.c +++ b/reactos/base/shell/cmd/batch.c @@ -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 (..) */