Module: wine
Branch: master
Commit: b29cdbd5f23548d9631e5c98ec923b6d2d16a3f8
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b29cdbd5f23548d9631e5c98…
Author: Rodrigo Saboya <saboya(a)gmail.com>
Date: Tue Sep 11 14:27:42 2018 -0300
wine.inf: Updates E. South America Standard Time DST data.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45786
Signed-off-by: Rodrigo Saboya <saboya(a)gmail.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
loader/wine.inf.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 4f241c0..f10284b 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -2806,7 +2806,7 @@ HKLM,%CurrentVersionNT%\Time Zones\E. Australia Standard Time,"TZI",1,a8,fd,ff,f
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Display",,"America/Sao_Paulo"
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Dlt",,"E. South America Daylight Time"
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"Std",,"E. South America Standard Time"
-HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00
+HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time,"TZI",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,00,00,00,00,00,00,00,00,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2015",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,df,07,02,00,00,00,16,00,00,00,00,00,00,00,00,00,df,07,0a,00,00,00,12,00,00,00,00,00,00,00,00,00
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2023",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,e7,07,02,00,00,00,1a,00,00,00,00,00,00,00,00,00,e7,07,0a,00,00,00,0f,00,00,00,00,00,00,00,00,00
HKLM,%CurrentVersionNT%\Time Zones\E. South America Standard Time\Dynamic DST,"2026",1,b4,00,00,00,00,00,00,00,c4,ff,ff,ff,ea,07,02,00,00,00,16,00,00,00,00,00,00,00,00,00,ea,07,0a,00,00,00,12,00,00,00,00,00,00,00,00,00
Module: wine
Branch: master
Commit: f87e25a7bc2a8917091a9d9d93139bb77eb1e154
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f87e25a7bc2a8917091a9d9d…
Author: Jason Edmeades <us(a)edmeades.me.uk>
Date: Mon Sep 10 23:30:20 2018 +0100
cmd: Handle unechoed rem commands inside a (..) section.
When processing a (..) multiline section, each line is processed and
if it starts with a '@' it is not echoed, but more importantly if is
'rem' then anything else on that line should be ignored. The reported
issue was that a pipe was being executed when it was hidden behind a
rem, which was trigged by the preceeding '@' character not being
skipped.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45729
Signed-off-by: Jason Edmeades <us(a)edmeades.me.uk>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/cmd/tests/test_builtins.cmd | 6 ++++++
programs/cmd/tests/test_builtins.cmd.exp | 1 +
programs/cmd/wcmdmain.c | 13 +++++++++++--
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index bed3950..79233d8 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1427,6 +1427,12 @@ for /L %%i in (2,2,1) do (
echo %%i
echo FAILED
)
+echo --- rems inside for loops
+for /f %%i IN ("hello") DO (
+ REM foo|echo ERROR unexpected execution 1
+ @REM foo|echo ERROR unexpected execution 2
+ @ REM foo|echo ERROR unexpected execution 3
+)
echo --- ifs inside for loops
for %%i in (test) do (
echo a1
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 5cca037..797a9cc 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -996,6 +996,7 @@ ErrorLevel 0
-1
1
3
+--- rems inside for loops
--- ifs inside for loops
a1
b1
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index c8a41d3..5ef4a2b 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -2308,12 +2308,21 @@ WCHAR *WCMD_ReadAndParseLine(const WCHAR *optionalcmd, CMD_LIST **output, HANDLE
} while (*extraData == 0x00);
curPos = extraSpace;
- if (context) handleExpansion(extraSpace, FALSE, FALSE);
+
+ /* Skip preceding whitespace */
+ while (*curPos == ' ' || *curPos == '\t') curPos++;
+
+ /* Replace env vars if in a batch context */
+ if (context) handleExpansion(curPos, FALSE, FALSE);
+
/* Continue to echo commands IF echo is on and in batch program */
- if (context && echo_mode && extraSpace[0] && (extraSpace[0] != '@')) {
+ if (context && echo_mode && *curPos && *curPos != '@') {
WCMD_output_asis(extraSpace);
WCMD_output_asis(newlineW);
}
+
+ /* Skip repeated 'no echo' characters and whitespace */
+ while (*curPos == '@' || *curPos == ' ' || *curPos == '\t') curPos++;
}
}
Module: wine
Branch: master
Commit: 1a7333bec627a31a43d380ecc63e5792e302373e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=1a7333bec627a31a43d380ec…
Author: Jason Edmeades <us(a)edmeades.me.uk>
Date: Mon Sep 10 23:30:19 2018 +0100
cmd: Handle "for" loop handling of tokens, where * does not follow a number.
With the 'for' loop /f syntax, if tokens are requested the the normal
syntax is something like tokens=1,2* but there is valid syntax like
1,2,* (which effectively means the same). Make this other syntax work.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45722
Signed-off-by: Jason Edmeades <us(a)edmeades.me.uk>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/cmd/builtins.c | 48 +++++++++++++++++++-------------
programs/cmd/tests/test_builtins.cmd | 3 +-
programs/cmd/tests/test_builtins.cmd.exp | 1 +
3 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 1e6181d..e6a9ce3 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -1836,8 +1836,8 @@ static int WCMD_for_nexttoken(int lasttoken, WCHAR *tokenstr,
if (doall) *doall = FALSE;
if (duplicates) *duplicates = FALSE;
- WINE_TRACE("Find next token after %d in %s was %d\n", lasttoken,
- wine_dbgstr_w(tokenstr), nexttoken);
+ WINE_TRACE("Find next token after %d in %s\n", lasttoken,
+ wine_dbgstr_w(tokenstr));
/* Loop through the token string, parsing it. Valid syntax is:
token=m or x-y with comma delimiter and optionally * to finish*/
@@ -1845,11 +1845,21 @@ static int WCMD_for_nexttoken(int lasttoken, WCHAR *tokenstr,
int nextnumber1, nextnumber2 = -1;
WCHAR *nextchar;
- /* It is valid syntax tokens=* which just means get whole line */
+ /* Remember if the next character is a star, it indicates a need to
+ show all remaining tokens and should be the last character */
if (*pos == '*') {
if (doall) *doall = TRUE;
if (totalfound) (*totalfound)++;
- nexttoken = 0;
+ /* If we have not found a next token to return, then indicate
+ time to process the star */
+ if (nexttoken == -1) {
+ if (lasttoken == -1) {
+ /* Special case the syntax of tokens=* which just means get whole line */
+ nexttoken = 0;
+ } else {
+ nexttoken = lasttoken;
+ }
+ }
break;
}
@@ -1882,8 +1892,9 @@ static int WCMD_for_nexttoken(int lasttoken, WCHAR *tokenstr,
if (nextnumber2 >= nextnumber1 && totalfound) {
*totalfound = *totalfound + 1 + (nextnumber2 - nextnumber1);
}
+ pos = nextchar;
- } else {
+ } else if (pos != nextchar) {
if (totalfound) (*totalfound)++;
/* See if the number found is one we have already seen */
@@ -1894,26 +1905,25 @@ static int WCMD_for_nexttoken(int lasttoken, WCHAR *tokenstr,
((nexttoken == -1) || (nextnumber1 < nexttoken))) {
nexttoken = nextnumber1;
}
+ pos = nextchar;
+ } else {
+ /* Step on to the next character, usually over comma */
+ if (*pos) pos++;
}
- /* Remember if it is followed by a star, and if it is indicate a need to
- show all tokens, unless a duplicate has been found */
- if (*nextchar == '*') {
- if (doall) *doall = TRUE;
- if (totalfound) (*totalfound)++;
- }
-
- /* Step on to the next character */
- pos = nextchar;
- if (*pos) pos++;
}
/* Return result */
- if (nexttoken == -1) nexttoken = lasttoken;
- WINE_TRACE("Found next token after %d was %d\n", lasttoken, nexttoken);
- if (totalfound) WINE_TRACE("Found total tokens in total %d\n", *totalfound);
- if (doall && *doall) WINE_TRACE("Request for all tokens found\n");
+ if (nexttoken == -1) {
+ WINE_TRACE("No next token found, previous was %d\n", lasttoken);
+ nexttoken = lasttoken;
+ } else if (nexttoken==lasttoken && doall && *doall) {
+ WINE_TRACE("Request for all remaining tokens now\n");
+ } else {
+ WINE_TRACE("Found next token after %d was %d\n", lasttoken, nexttoken);
+ }
+ if (totalfound) WINE_TRACE("Found total tokens to be %d\n", *totalfound);
if (duplicates && *duplicates) WINE_TRACE("Duplicate numbers found\n");
return nexttoken;
}
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index e74d491..bed3950 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1840,11 +1840,12 @@ for /f "tokens=1,2,3*" %%i in ("a b c d e f g") do echo h=%%h i=%%i j=%%j k=%%k
for /f "tokens=1,1,3*" %%i in ("a b c d e f g") do echo h=%%h i=%%i j=%%j k=%%k l=%%l m=%%m n=%%n o=%%o
for /f "tokens=2,2,3*" %%i in ("a b c d e f g") do echo h=%%h i=%%i j=%%j k=%%k l=%%l m=%%m n=%%n o=%%o
for /f "tokens=3,2,3*" %%i in ("a b c d e f g") do echo h=%%h i=%%i j=%%j k=%%k l=%%l m=%%m n=%%n o=%%o
-rem Special case tokens=*
+rem Special case tokens=* or tokens=n,*
echo 3.14>testfile
FOR /F "tokens=*" %%A IN (testfile) DO @echo 1:%%A,%%B
FOR /F "tokens=1*" %%A IN (testfile) DO @echo 2:%%A,%%B
FOR /F "tokens=2*" %%A IN (testfile) DO @echo 3:%%A,%%B
+FOR /F "tokens=1,* delims=." %%A IN (testfile) DO @echo 4:%%A,%%B
del testfile
cd ..
rd /s/q foobar
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 021a5b0..5cca037 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -1269,6 +1269,7 @@ h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
h=%h i=b j=c k= l= m=%m n=%n o=%o@or_broken@h=%h i=b j=c k= l= m= n=%n o=%o
1:3.14,%B
2:3.14,
+4:3,14
------ parameter splitting
:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@
:forFParameterSplittingFunc myparam1=myvalue1 myparam2=myparam2 mytest@space@@space@@space@
Module: wine
Branch: master
Commit: becfbb80b4e80680b32cc240b2465e4972590b14
URL: https://source.winehq.org/git/wine.git/?a=commit;h=becfbb80b4e80680b32cc240…
Author: Jason Edmeades <us(a)edmeades.me.uk>
Date: Mon Sep 10 23:30:18 2018 +0100
cmd: Handle whitespace in 'for' argument items.
Avoid whitespace affecting the parsing of a for loops items. The
leading and trailing quote or backtick needed removing, and it was
assumed that the trailing character would be that character, which was
wrong when there was whitespace unless the parameter is trimmed.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45731
Signed-off-by: Jason Edmeades <us(a)edmeades.me.uk>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
programs/cmd/builtins.c | 8 +++++++-
programs/cmd/tests/test_builtins.cmd | 7 ++++++-
programs/cmd/tests/test_builtins.cmd.exp | 4 ++++
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 25d5be1..1e6181d 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -2069,17 +2069,22 @@ static HANDLE WCMD_forf_getinputhandle(BOOL usebackq, WCHAR *itemstr, BOOL iscmd
WCHAR temp_str[MAX_PATH];
WCHAR temp_file[MAX_PATH];
WCHAR temp_cmd[MAXSTRING];
+ WCHAR *trimmed = NULL;
HANDLE hinput = INVALID_HANDLE_VALUE;
static const WCHAR redirOutW[] = {'>','%','s','\0'};
static const WCHAR cmdW[] = {'C','M','D','\0'};
static const WCHAR cmdslashcW[] = {'C','M','D','.','E','X','E',' ',
'/','C',' ','%','s','\0'};
- /* Remove leading and trailing character */
+ /* Remove leading and trailing character (but there may be trailing whitespace too) */
if ((iscmd && (itemstr[0] == '`' && usebackq)) ||
(iscmd && (itemstr[0] == '\'' && !usebackq)) ||
(!iscmd && (itemstr[0] == '"' && usebackq)))
{
+ trimmed = WCMD_strtrim(itemstr);
+ if (trimmed) {
+ itemstr = trimmed;
+ }
itemstr[strlenW(itemstr)-1] = 0x00;
itemstr++;
}
@@ -2106,6 +2111,7 @@ static HANDLE WCMD_forf_getinputhandle(BOOL usebackq, WCHAR *itemstr, BOOL iscmd
hinput = CreateFileW(itemstr, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
}
+ heap_free(trimmed);
return hinput;
}
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index de9c889..e74d491 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -1702,8 +1702,11 @@ mkdir foobar & cd foobar
echo ------ string argument
rem NT4 does not support usebackq
for /F %%i in ("a b c") do echo %%i
+for /F %%i in ( "a b c" ) do echo X%%iX
for /f usebackq %%i in ('a b c') do echo %%i>output_file
if not exist output_file (echo no output) else (type output_file & del output_file)
+for /f usebackq %%i in ( 'a b c' ) do echo X%%iX>output_file
+if not exist output_file (echo no output) else (type output_file & del output_file)
for /f %%i in ("a ") do echo %%i
for /f usebackq %%i in ('a ') do echo %%i>output_file
if not exist output_file (echo no output) else (type output_file & del output_file)
@@ -1755,9 +1758,11 @@ for /f "usebackq" %%i in (`echo.Passed2`) do echo %%i
for /f usebackq %%i in (`echo.Passed3`) do echo %%i
for /f "usebackq" %%i in (`"c:\windows\system32\cmd.exe" /C echo Passed4`) do echo %%i
for /f "usebackq" %%i in (`""c:\windows\system32\cmd.exe" /C echo Passed5"`) do echo %%i
+for /f %%i in ( 'echo.Passed6' ) do echo %%i
+for /f "usebackq" %%i in ( `echo.Passed7` ) do echo %%i
goto :ContinueFORF
:SkipFORFcmdNT4
-for /l %%i in (1,1,5) do echo Missing functionality - Broken%%i
+for /l %%i in (1,1,7) do echo Missing functionality - Broken%%i
:ContinueFORF
rem FIXME: Rest not testable right now in wine: not implemented and would need
rem preliminary grep-like program implementation (e.g. like findstr or fc) even
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 3829318..021a5b0 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -1180,7 +1180,9 @@ WINE_bar correctly 6@or_broken@ERROR: WINE_bar incorrectly 5 [6]
--- for /F
------ string argument
a
+XaX
a@or_broken@no output
+XaX@or_broken@no output
a
a@or_broken@no output
a
@@ -1218,6 +1220,8 @@ Passed2@or_broken@Missing functionality - Broken2
Passed3@or_broken@Missing functionality - Broken3
Passed4@or_broken@Missing functionality - Broken4
Passed5@or_broken@Missing functionality - Broken5
+Passed6@or_broken@Missing functionality - Broken6
+Passed7@or_broken@Missing functionality - Broken7
------ eol option
and@or_broken@Broken NT4 functionality1
Line@or_broken@Broken NT4 functionality2