cmd: fixing an error with redirection operators
Nowres Rafid
nowres.rafed at gmail.com
Fri Aug 19 12:39:02 CDT 2011
---
programs/cmd/tests/test_builtins.cmd.exp | 20 ++++++++++----------
programs/cmd/wcmdmain.c | 4 ++--
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 7ebe57a..edd518d 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -67,9 +67,9 @@ word at space@@space@
...stdout redirection
foo
foo at space@
- at todo_wine@foo1
- at todo_wine@foo11
- at todo_wine@foo12
+foo1
+foo11
+foo12
...stdout appending
foo
foo at space@
@@ -78,12 +78,12 @@ foob at space@
fooc at space@
foob at space@
fooc at space@
- at todo_wine@food1
- at todo_wine@foob at space@
- at todo_wine@fooc at space@
- at todo_wine@food1
- at todo_wine@food2
- at todo_wine@food21
+food1
+foob at space@
+fooc at space@
+food1
+food2
+food21
@todo_wine at ------------ Testing ^ escape character --------------
@todo_wine at hello, world
@todo_wine at hello, world
@@ -379,7 +379,7 @@ foobar removed
bar\baz removed
------------ Testing CALL --------------
foo at space@
- at todo_wine@foo 8
+foo 8
foo at space@@space@
foo bar at space@
@todo_wine at foo ""@space@
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 0111c15..8565f9a 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1935,8 +1935,8 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF
/* See if 1>, 2> etc, in which case we have some patching up
to do */
- if (curPos != extraSpace &&
- *(curPos-1)>='1' && *(curPos-1)<='9') {
+ if (curPos != extraSpace && curStringLen > 1 &&
+ *(curPos-1)>='1' && *(curPos-1)<='9' && *(curPos-2)==' ') {
curStringLen--;
curString[curStringLen] = 0x00;
--
1.7.4.1
--=-vcJhpVt0SFGPL+szai/6--
More information about the wine-patches
mailing list