Module: wine Branch: master Commit: 4f71f4af59b8989b2288800a7b337f61475df505 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4f71f4af59b8989b2288800a7b...
Author: Jason Edmeades jason@edmeades.me.uk Date: Tue Sep 4 00:30:17 2012 +0100
cmd: Fix "PATH=value" command.
---
programs/cmd/builtins.c | 2 +- programs/cmd/tests/test_builtins.cmd | 11 +++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 4 ++++ 3 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c index 16f4eff..b2546d4 100644 --- a/programs/cmd/builtins.c +++ b/programs/cmd/builtins.c @@ -2371,7 +2371,7 @@ void WCMD_setshow_path (const WCHAR *command) { static const WCHAR pathW[] = {'P','A','T','H','\0'}; static const WCHAR pathEqW[] = {'P','A','T','H','=','\0'};
- if (strlenW(param1) == 0) { + if (strlenW(param1) == 0 && strlenW(param2) == 0) { status = GetEnvironmentVariableW(pathW, string, sizeof(string)/sizeof(WCHAR)); if (status != 0) { WCMD_output_asis ( pathEqW); diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 13b53c5..093cc23 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -1530,6 +1530,17 @@ if d==d goto dest4 :dest4@space@ echo goto with a following space worked
+echo ------------ Testing PATH ------------ +set backup_path=%path% +set path=original +path +path try2 +path +path=try3 +path +set path=%backup_path% +set backup_path= + echo ------------ Testing combined CALLs/GOTOs ------------ echo @echo off>foo.cmd echo goto :eof>>foot.cmd diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index b7bcd96..93b11e5 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -825,6 +825,10 @@ goto with no leading space worked goto with a leading space worked goto with a leading tab worked goto with a following space worked +------------ Testing PATH ------------ +PATH=original +PATH=try2 +PATH=try3 ------------ Testing combined CALLs/GOTOs ------------ world cheball