Jason Edmeades : cmd: Add circumflex support into command shell.
Alexandre Julliard
julliard at winehq.org
Wed Sep 26 14:06:51 CDT 2012
Module: wine
Branch: master
Commit: d8c0fbcedc266fadcb48cd560adcc909c9738d0d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d8c0fbcedc266fadcb48cd560adcc909c9738d0d
Author: Jason Edmeades <jason at edmeades.me.uk>
Date: Tue Sep 25 13:45:28 2012 +0100
cmd: Add circumflex support into command shell.
---
programs/cmd/tests/test_builtins.cmd.exp | 34 +++++++++++++++---------------
programs/cmd/wcmdmain.c | 4 +++
2 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index a4f874c..b019280 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -123,7 +123,7 @@ bar2
'a', '~`+', '.{}!+b'
'a', 'b', ''
'"a;b"', '', ''
- at todo_wine@'a', 'b', ''
+'a', 'b', ''
'a[b]{c}(d)e', '', ''
'a', '', ''
second line
@@ -197,25 +197,25 @@ A
B
C
------------ Testing circumflex escape character ------------
- at todo_wine@hello, world
- at todo_wine@hello, world
- at todo_wine@hell^o, world
- at todo_wine@hell^o, world
+hello, world
+hello, world
+hell^o, world
+hell^o, world
+baz
baz
- at todo_wine@baz
- at todo_wine@foo | echo bar
- at todo_wine@foo & echo bar
- at todo_wine@bak &
+foo | echo bar
+foo & echo bar
+bak &
baz at space@
0 at or_broken@1
- at todo_wine@foo > foo
- at todo_wine@<
- at todo_wine@ffoof
- at todo_wine@FOO=bar | baz
- at todo_wine@0
- at todo_wine@FOO=bar ^| baz
- at todo_wine@bar | baz
- at todo_wine@0
+foo > foo
+<
+ffoof
+FOO=bar | baz
+0
+FOO=bar ^| baz
+bar | baz
+0
------------ Testing 'set' ------------
1
0
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 94d2b76..a328f83 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -2070,6 +2070,10 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
}
break;
+ case '^': if (!inQuotes) curPos++;
+ curCopyTo[(*curLen)++] = *curPos;
+ break;
+
case '&': if (!inQuotes) {
lastWasRedirect = FALSE;
More information about the wine-cvs
mailing list