Frédéric Delanoy : cmd: Fix REM tab handling.
Module: wine Branch: master Commit: 6d3fd3abcdcd67142c43e0f4a3357b1c32a15563 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6d3fd3abcdcd67142c43e0f4a3... Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Thu Aug 25 00:48:21 2011 +0200 cmd: Fix REM tab handling. --- programs/cmd/tests/test_builtins.cmd | 6 ++++++ programs/cmd/tests/test_builtins.cmd.exp | 6 ++++++ programs/cmd/wcmdmain.c | 7 +++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 7c3353f..cd46dbd 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -58,12 +58,18 @@ rem Hello rem Hello || foo rem echo lol rem echo foo & echo bar +rem @tab@ Hello +rem(a)tab@ Hello +rem(a)tab@echo foo & echo bar @echo on rem Hello rem Hello rem Hello || foo rem echo lol rem echo foo & echo bar +rem @tab@ Hello +rem(a)tab@ Hello +rem(a)tab@echo foo & echo bar @echo off echo ------------ Testing redirection operators -------------- diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 7435c72..dafb6a3 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -106,6 +106,12 @@ word @pwd@>rem echo lol(a)space@ @pwd@>rem echo foo & echo bar(a)space@ + +(a)pwd@>rem @tab@ Hello(a)space@ + +(a)pwd@>rem(a)tab@ Hello(a)space@ + +(a)pwd@>rem(a)tab@echo foo & echo bar(a)space@ ------------ Testing redirection operators -------------- ...stdout redirection foo diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 47af612..3efabfa 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1753,7 +1753,7 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE CMD_LIST *lastEntry = NULL; CMD_DELIMITERS prevDelim = CMD_NONE; static WCHAR *extraSpace = NULL; /* Deliberately never freed */ - const WCHAR remCmd[] = {'r','e','m',' ','\0'}; + const WCHAR remCmd[] = {'r','e','m'}; const WCHAR forCmd[] = {'f','o','r'}; const WCHAR ifCmd[] = {'i','f',' ','\0'}; const WCHAR ifElse[] = {'e','l','s','e',' ','\0'}; @@ -1840,9 +1840,8 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE if (curStringLen == 0 && curCopyTo == curString) { const WCHAR forDO[] = {'d','o'}; - /* If command starts with 'rem', ignore any &&, ( etc */ - if (CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, - curPos, 4, remCmd, -1) == CSTR_EQUAL) { + /* If command starts with 'rem ', ignore any &&, ( etc. */ + if (WCMD_keyword_ws_found(remCmd, sizeof(remCmd)/sizeof(remCmd[0]), curPos)) { inRem = TRUE; } else if (WCMD_keyword_ws_found(forCmd, sizeof(forCmd)/sizeof(forCmd[0]), curPos)) {
participants (1)
-
Alexandre Julliard