winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
June 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
5 participants
856 discussions
Start a n
N
ew thread
appdb/include testData_queue.php
by WineHQ
19 Jun '07
19 Jun '07
ChangeSet ID: 31222 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/06/18 19:28:01 Modified files: include : testData_queue.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> testData_queue: always delete empty distributions if we can Patch:
http://cvs.winehq.org/patch.py?id=31222
Old revision New revision Changes Path 1.11 1.12 +1 -1 appdb/include/testData_queue.php Index: appdb/include/testData_queue.php diff -u -p appdb/include/testData_queue.php:1.11 appdb/include/testData_queue.php:1.12 --- appdb/include/testData_queue.php:1.11 19 Jun 2007 0:28: 1 -0000 +++ appdb/include/testData_queue.php 19 Jun 2007 0:28: 1 -0000 @@ -31,7 +31,7 @@ class testData_queue queue for admins to clean up unused, queued entries */ $this->oDistribution = new distribution($this->oDistribution->iDistributionId); if(!sizeof($this->oDistribution->aTestingIds) && - $this->oDistribution->sQueued != "false") + $this->oDistribution->canEdit()) $this->oDistribution->delete(); return $bSuccess;
1
0
0
0
appdb/unit_test test_appData.php
by WineHQ
19 Jun '07
19 Jun '07
ChangeSet ID: 31221 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/06/18 19:27:13 Modified files: unit_test : test_appData.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Cleanup appData test Patch:
http://cvs.winehq.org/patch.py?id=31221
Old revision New revision Changes Path 1.2 1.3 +5 -0 appdb/unit_test/test_appData.php Index: appdb/unit_test/test_appData.php diff -u -p appdb/unit_test/test_appData.php:1.2 appdb/unit_test/test_appData.php:1.3 --- appdb/unit_test/test_appData.php:1.2 19 Jun 2007 0:27:13 -0000 +++ appdb/unit_test/test_appData.php 19 Jun 2007 0:27:13 -0000 @@ -27,12 +27,17 @@ function test_appData_listSubmittedBy() $shReturn = appData::listSubmittedBy($oUser->iUserId, true); + /* This is needed for deleting the entry */ + $oUser->addPriv("admin"); + /* There should be two lines; one header and one for the downloadurl */ $iExpected = 2; $iReceived = substr_count($shReturn, "</tr>"); if($iExpected != $iReceived) { echo "Got $iReceived rows instead of $iExpected.\n"; + $oDownloadUrl->delete(); + $oUser->delete(); return FALSE; }
1
0
0
0
appdb/ include/downloadurl.php include/screens ...
by WineHQ
19 Jun '07
19 Jun '07
ChangeSet ID: 31220 CVSROOT: /opt/cvs-commit Module name: appdb Changes by: wineowner(a)winehq.org 2007/06/18 19:26:21 Modified files: include : downloadurl.php screenshot.php version.php unit_test : test_om_objects.php Log message: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Cleanup objectManager tests so all objects created during the test are deleted Patch:
http://cvs.winehq.org/patch.py?id=31220
Old revision New revision Changes Path 1.19 1.20 +1 -0 appdb/include/downloadurl.php 1.71 1.72 +1 -1 appdb/include/screenshot.php 1.132 1.133 +1 -1 appdb/include/version.php 1.15 1.16 +65 -24 appdb/unit_test/test_om_objects.php
1
0
0
0
Jason Edmeades : cmd.exe: for loop by default only matches files.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: 196fb10c327241f3a27a96faa44e149160395c85 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=196fb10c327241f3a27a96faa…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:29 2007 +0100 cmd.exe: for loop by default only matches files. --- programs/cmd/builtins.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index a764228..2a075c5 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -593,6 +593,7 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) { WCHAR variable[4]; WCHAR *firstCmd; int thisDepth; + BOOL isDirs = FALSE; /* Check: the first line includes the % variable name as first parm @@ -667,10 +668,15 @@ void WCMD_for (WCHAR *p, CMD_LIST **cmdList) { hff = FindFirstFile (item, &fd); if (hff != INVALID_HANDLE_VALUE) { do { - thisCmdStart = cmdStart; - WINE_TRACE("Processing FOR filename %s\n", wine_dbgstr_w(fd.cFileName)); - WCMD_part_execute (&thisCmdStart, firstCmd, variable, - fd.cFileName, FALSE, TRUE); + BOOL isDirectory = (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); + if ((isDirs && isDirectory) || + (!isDirs && !isDirectory)) + { + thisCmdStart = cmdStart; + WINE_TRACE("Processing FOR filename %s\n", wine_dbgstr_w(fd.cFileName)); + WCMD_part_execute (&thisCmdStart, firstCmd, variable, + fd.cFileName, FALSE, TRUE); + } } while (FindNextFile(hff, &fd) != 0); FindClose (hff);
1
0
0
0
Jason Edmeades : cmd.exe: Fix FOR so it works as 'well' as before.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: 54d890ca1e4cf8a52e6a468bc43d1d916bb2b800 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=54d890ca1e4cf8a52e6a468bc…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:28 2007 +0100 cmd.exe: Fix FOR so it works as 'well' as before. --- programs/cmd/batch.c | 20 +--- programs/cmd/builtins.c | 339 ++++++++++++++++++++++++++++++----------------- programs/cmd/wcmd.h | 9 +- programs/cmd/wcmdmain.c | 61 ++++++--- 4 files changed, 272 insertions(+), 157 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=54d890ca1e4cf8a52e6a4…
1
0
0
0
Jason Edmeades : cmd.exe: Support IF..ELSE processing tolerate multiline/ part lines.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: d2e7b401a296b3b8ec7370909190230e2d184f1f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2e7b401a296b3b8ec7370909…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:27 2007 +0100 cmd.exe: Support IF..ELSE processing tolerate multiline/part lines. --- programs/cmd/batch.c | 2 +- programs/cmd/builtins.c | 89 +++++++++++++++++++++++++++++++++++++++++++++-- programs/cmd/wcmd.h | 2 +- programs/cmd/wcmdmain.c | 61 ++++++++++++++++++++++---------- 4 files changed, 130 insertions(+), 24 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=d2e7b401a296b3b8ec737…
1
0
0
0
Jason Edmeades : cmd.exe: Correctly parse IF ELSE plus multipart/multiline.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: 345cb891752d6f594c488a371f702b013a6e7aca URL:
http://source.winehq.org/git/wine.git/?a=commit;h=345cb891752d6f594c488a371…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:26 2007 +0100 cmd.exe: Correctly parse IF ELSE plus multipart/multiline. --- programs/cmd/wcmdmain.c | 49 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 41 insertions(+), 8 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 5ccd6d8..a9beb61 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1909,12 +1909,17 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF static WCHAR *extraSpace = NULL; /* Deliberately never freed */ const WCHAR remCmd[] = {'r','e','m',' ','\0'}; const WCHAR forCmd[] = {'f','o','r',' ','\0'}; + const WCHAR ifCmd[] = {'i','f',' ','\0'}; + const WCHAR ifElse[] = {'e','l','s','e',' ','\0'}; BOOL inRem = FALSE; BOOL inFor = FALSE; + BOOL inIf = FALSE; + BOOL inElse= FALSE; BOOL onlyWhiteSpace = FALSE; BOOL lastWasWhiteSpace = FALSE; - BOOL lastWasDo = FALSE; - BOOL lastWasIn = FALSE; + BOOL lastWasDo = FALSE; + BOOL lastWasIn = FALSE; + BOOL lastWasElse = FALSE; /* Allocate working space for a command read from keyboard, file etc */ if (!extraSpace) @@ -1952,7 +1957,7 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF /* Certain commands need special handling */ if (curLen == 0) { - const WCHAR forDO[] = {'d','o',' ','\0'}; + const WCHAR forDO[] = {'d','o',' ','\0'}; /* If command starts with 'rem', ignore any &&, ( etc */ if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, @@ -1964,6 +1969,26 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF curPos, 4, forCmd, -1) == 2) { inFor = TRUE; + /* If command starts with 'if' or 'else', handle ('s mid line. We should ensure this + is only true in the command portion of the IF statement, but this + should suffice for now + FIXME: Silly syntax like "if 1(==1( ( + echo they equal + )" will be parsed wrong */ + } else if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 3, ifCmd, -1) == 2) { + inIf = TRUE; + + } else if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 5, ifElse, -1) == 2) { + inElse = TRUE; + lastWasElse = TRUE; + onlyWhiteSpace = TRUE; + memcpy(&curString[curLen], curPos, 5*sizeof(WCHAR)); + curLen+=5; + curPos+=5; + continue; + /* In a for loop, the DO command will follow a close bracket followed by whitespace, followed by DO, ie closeBracket inserts a NULL entry, curLen is then 0, and all whitespace is skipped */ @@ -2025,10 +2050,12 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF ie start of line or just after &&, then we read until an unquoted ) is found */ WINE_TRACE("Found '(' conditions: curLen(%d), inQ(%d), onlyWS(%d)" - ", for(%d, In:%d, Do:%d)\n", + ", for(%d, In:%d, Do:%d)" + ", if(%d, else:%d, lwe:%d)\n", curLen, inQuotes, onlyWhiteSpace, - inFor, lastWasIn, lastWasDo); + inFor, lastWasIn, lastWasDo, + inIf, inElse, lastWasElse); if (curLen == 0) { curDepth++; @@ -2037,8 +2064,15 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF curString[curLen++] = *curPos; /* In a FOR loop, an unquoted '(' may occur straight after - IN or DO */ - } else if (inFor && (lastWasIn || lastWasDo) && onlyWhiteSpace) { + IN or DO + In an IF statement just handle it regardless as we don't + parse the operands + In an ELSE statement, only allow it straight away after + the ELSE and whitespace + */ + } else if (inIf || + (inElse && lastWasElse && onlyWhiteSpace) || + (inFor && (lastWasIn || lastWasDo) && onlyWhiteSpace)) { /* Add the current command */ thisEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(CMD_LIST)); @@ -2166,7 +2200,6 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF /* If we have reached the end of the string, see if bracketing outstanding */ if (*curPos == 0x00 && curDepth > 0 && readFrom != INVALID_HANDLE_VALUE) { inRem = FALSE; - inFor = FALSE; isAmphersand = FALSE; inQuotes = FALSE; memset(extraSpace, 0x00, (MAXSTRING+1) * sizeof(WCHAR));
1
0
0
0
Jason Edmeades : cmd.exe: Parse multipart FOR statements.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: d4afe81c3f839066ff5eaa292bd90db58aaf029f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d4afe81c3f839066ff5eaa292…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:25 2007 +0100 cmd.exe: Parse multipart FOR statements. --- programs/cmd/wcmdmain.c | 118 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 110 insertions(+), 8 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index a690cb0..5ccd6d8 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1907,8 +1907,14 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF CMD_LIST *lastEntry = NULL; BOOL isAmphersand = FALSE; static WCHAR *extraSpace = NULL; /* Deliberately never freed */ - const WCHAR rem[] = {'r','e','m',' ','\0'}; + const WCHAR remCmd[] = {'r','e','m',' ','\0'}; + const WCHAR forCmd[] = {'f','o','r',' ','\0'}; BOOL inRem = FALSE; + BOOL inFor = FALSE; + BOOL onlyWhiteSpace = FALSE; + BOOL lastWasWhiteSpace = FALSE; + BOOL lastWasDo = FALSE; + BOOL lastWasIn = FALSE; /* Allocate working space for a command read from keyboard, file etc */ if (!extraSpace) @@ -1939,13 +1945,57 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF WCHAR thisChar; - /* If command starts with 'rem', ignore any &&, ( etc */ - if (curLen == 0 && !inRem) { + /* Debugging AID: + WINE_TRACE("Looking at '%c' (len:%d, lws:%d, ows:%d)\n", *curPos, curLen, + lastWasWhiteSpace, onlyWhiteSpace); + */ + + /* Certain commands need special handling */ + if (curLen == 0) { + const WCHAR forDO[] = {'d','o',' ','\0'}; + + /* If command starts with 'rem', ignore any &&, ( etc */ if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, - curPos, 4, rem, -1) == 2) { + curPos, 4, remCmd, -1) == 2) { inRem = TRUE; - } else { - inRem = FALSE; + + /* If command starts with 'for', handle ('s mid line after IN or DO */ + } else if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 4, forCmd, -1) == 2) { + inFor = TRUE; + + /* In a for loop, the DO command will follow a close bracket followed by + whitespace, followed by DO, ie closeBracket inserts a NULL entry, curLen + is then 0, and all whitespace is skipped */ + } else if (inFor && + (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 3, forDO, -1) == 2)) { + WINE_TRACE("Found DO\n"); + lastWasDo = TRUE; + onlyWhiteSpace = TRUE; + memcpy(&curString[curLen], curPos, 3*sizeof(WCHAR)); + curLen+=3; + curPos+=3; + continue; + } + } else { + + /* Special handling for the 'FOR' command */ + if (inFor && lastWasWhiteSpace) { + const WCHAR forIN[] = {'i','n',' ','\0'}; + + WINE_TRACE("Found 'FOR', comparing next parm: '%s'\n", wine_dbgstr_w(curPos)); + + if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 3, forIN, -1) == 2) { + WINE_TRACE("Found IN\n"); + lastWasIn = TRUE; + onlyWhiteSpace = TRUE; + memcpy(&curString[curLen], curPos, 3*sizeof(WCHAR)); + curLen+=3; + curPos+=3; + continue; + } } } @@ -1955,20 +2005,61 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF if (!inRem) thisChar = *curPos; else thisChar = 'X'; /* Character with no special processing */ + lastWasWhiteSpace = FALSE; /* Will be reset below */ + switch (thisChar) { case '\t':/* drop through - ignore whitespace at the start of a command */ case ' ': if (curLen > 0) curString[curLen++] = *curPos; + + /* Remember just processed whitespace */ + lastWasWhiteSpace = TRUE; + break; case '"': inQuotes = !inQuotes; break; - case '(': if (inQuotes || curLen > 0) { + case '(': /* If a '(' is the first non whitespace in a command portion + ie start of line or just after &&, then we read until an + unquoted ) is found */ + WINE_TRACE("Found '(' conditions: curLen(%d), inQ(%d), onlyWS(%d)" + ", for(%d, In:%d, Do:%d)\n", + curLen, inQuotes, + onlyWhiteSpace, + inFor, lastWasIn, lastWasDo); + if (curLen == 0) { + curDepth++; + + /* If in quotes, ignore brackets */ + } else if (inQuotes) { curString[curLen++] = *curPos; - } else { + + /* In a FOR loop, an unquoted '(' may occur straight after + IN or DO */ + } else if (inFor && (lastWasIn || lastWasDo) && onlyWhiteSpace) { + + /* Add the current command */ + thisEntry = HeapAlloc(GetProcessHeap(), 0, sizeof(CMD_LIST)); + thisEntry->command = HeapAlloc(GetProcessHeap(), 0, + (curLen+1) * sizeof(WCHAR)); + memcpy(thisEntry->command, curString, curLen * sizeof(WCHAR)); + thisEntry->command[curLen] = 0x00; + curLen = 0; + thisEntry->nextcommand = NULL; + thisEntry->isAmphersand = isAmphersand; + thisEntry->bracketDepth = curDepth; + if (lastEntry) { + lastEntry->nextcommand = thisEntry; + } else { + *output = thisEntry; + } + lastEntry = thisEntry; + curDepth++; + } else { + curString[curLen++] = *curPos; } break; @@ -2041,6 +2132,16 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF curPos++; + /* At various times we need to know if we have only skipped whitespace, + so reset this variable and then it will remain true until a non + whitespace is found */ + if ((thisChar != ' ') && (thisChar != '\n')) onlyWhiteSpace = FALSE; + + /* Flag end of interest in FOR DO and IN parms once something has been processed */ + if (!lastWasWhiteSpace) { + lastWasIn = lastWasDo = FALSE; + } + /* If we have reached the end, add this command into the list */ if (*curPos == 0x00 && curLen > 0) { @@ -2065,6 +2166,7 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF /* If we have reached the end of the string, see if bracketing outstanding */ if (*curPos == 0x00 && curDepth > 0 && readFrom != INVALID_HANDLE_VALUE) { inRem = FALSE; + inFor = FALSE; isAmphersand = FALSE; inQuotes = FALSE; memset(extraSpace, 0x00, (MAXSTRING+1) * sizeof(WCHAR));
1
0
0
0
Jason Edmeades : cmd.exe: EXIT /b skips any residual commands.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: d2474dece3f242120b694594e55f30bc5cd433e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d2474dece3f242120b694594e…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:24 2007 +0100 cmd.exe: EXIT /b skips any residual commands. --- programs/cmd/builtins.c | 3 ++- programs/cmd/wcmd.h | 2 +- programs/cmd/wcmdmain.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 6901cd3..ebbef1b 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2053,7 +2053,7 @@ int WCMD_volume (int mode, WCHAR *path) { * */ -void WCMD_exit (void) { +void WCMD_exit (CMD_LIST **cmdList) { static const WCHAR parmB[] = {'/','B','\0'}; int rc = atoiW(param1); /* Note: atoi of empty parameter is 0 */ @@ -2061,6 +2061,7 @@ void WCMD_exit (void) { if (context && lstrcmpiW(quals, parmB) == 0) { errorlevel = rc; context -> skip_rest = TRUE; + *cmdList = NULL; } else { ExitProcess(rc); } diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h index c1af0bd..ebb0fde 100644 --- a/programs/cmd/wcmd.h +++ b/programs/cmd/wcmd.h @@ -50,7 +50,7 @@ void WCMD_directory (WCHAR *); void WCMD_echo (const WCHAR *); void WCMD_endlocal (void); void WCMD_enter_paged_mode(const WCHAR *); -void WCMD_exit (void); +void WCMD_exit (CMD_LIST **cmdList); void WCMD_for (WCHAR *, CMD_LIST **cmdList); void WCMD_give_help (WCHAR *command); void WCMD_goto (CMD_LIST **cmdList); diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 1addd55..a690cb0 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -799,7 +799,7 @@ void WCMD_process_command (WCHAR *command, CMD_LIST **cmdList) WCMD_more(p); break; case WCMD_EXIT: - WCMD_exit (); + WCMD_exit (cmdList); break; default: WCMD_run_program (whichcmd, 0);
1
0
0
0
Jason Edmeades : cmd.exe: Lines starting with REM ignore any multiline/ part characters.
by Alexandre Julliard
18 Jun '07
18 Jun '07
Module: wine Branch: master Commit: de4c6970a31782b004fae5d83399fda20bdd2747 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=de4c6970a31782b004fae5d83…
Author: Jason Edmeades <jason.edmeades(a)googlemail.com> Date: Fri Jun 15 20:59:23 2007 +0100 cmd.exe: Lines starting with REM ignore any multiline/part characters. --- programs/cmd/wcmdmain.c | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 30c1921..1addd55 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -1907,6 +1907,8 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF CMD_LIST *lastEntry = NULL; BOOL isAmphersand = FALSE; static WCHAR *extraSpace = NULL; /* Deliberately never freed */ + const WCHAR rem[] = {'r','e','m',' ','\0'}; + BOOL inRem = FALSE; /* Allocate working space for a command read from keyboard, file etc */ if (!extraSpace) @@ -1934,7 +1936,26 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF /* Parse every character on the line being processed */ while (*curPos != 0x00) { - switch (*curPos) { + + WCHAR thisChar; + + /* If command starts with 'rem', ignore any &&, ( etc */ + if (curLen == 0 && !inRem) { + if (CompareString (LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, + curPos, 4, rem, -1) == 2) { + inRem = TRUE; + } else { + inRem = FALSE; + } + } + + /* Nothing 'ends' a REM statement and &&, quotes etc are ineffective, + so just use the default processing ie skip character specific + matching below */ + if (!inRem) thisChar = *curPos; + else thisChar = 'X'; /* Character with no special processing */ + + switch (thisChar) { case '\t':/* drop through - ignore whitespace at the start of a command */ case ' ': if (curLen > 0) @@ -2043,6 +2064,7 @@ WCHAR *WCMD_ReadAndParseLine(WCHAR *optionalcmd, CMD_LIST **output, HANDLE readF /* If we have reached the end of the string, see if bracketing outstanding */ if (*curPos == 0x00 && curDepth > 0 && readFrom != INVALID_HANDLE_VALUE) { + inRem = FALSE; isAmphersand = FALSE; inQuotes = FALSE; memset(extraSpace, 0x00, (MAXSTRING+1) * sizeof(WCHAR));
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
86
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Results per page:
10
25
50
100
200