cmd: Fix "PATH=value" command.
This commit is contained in:
parent
682b276ac5
commit
4f71f4af59
|
@ -2371,7 +2371,7 @@ void WCMD_setshow_path (const WCHAR *command) {
|
||||||
static const WCHAR pathW[] = {'P','A','T','H','\0'};
|
static const WCHAR pathW[] = {'P','A','T','H','\0'};
|
||||||
static const WCHAR pathEqW[] = {'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));
|
status = GetEnvironmentVariableW(pathW, string, sizeof(string)/sizeof(WCHAR));
|
||||||
if (status != 0) {
|
if (status != 0) {
|
||||||
WCMD_output_asis ( pathEqW);
|
WCMD_output_asis ( pathEqW);
|
||||||
|
|
|
@ -1530,6 +1530,17 @@ if d==d goto dest4
|
||||||
:dest4@space@
|
:dest4@space@
|
||||||
echo goto with a following space worked
|
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 ------------ Testing combined CALLs/GOTOs ------------
|
||||||
echo @echo off>foo.cmd
|
echo @echo off>foo.cmd
|
||||||
echo goto :eof>>foot.cmd
|
echo goto :eof>>foot.cmd
|
||||||
|
|
|
@ -825,6 +825,10 @@ goto with no leading space worked
|
||||||
goto with a leading space worked
|
goto with a leading space worked
|
||||||
goto with a leading tab worked
|
goto with a leading tab worked
|
||||||
goto with a following space worked
|
goto with a following space worked
|
||||||
|
------------ Testing PATH ------------
|
||||||
|
PATH=original
|
||||||
|
PATH=try2
|
||||||
|
PATH=try3
|
||||||
------------ Testing combined CALLs/GOTOs ------------
|
------------ Testing combined CALLs/GOTOs ------------
|
||||||
world
|
world
|
||||||
cheball
|
cheball
|
||||||
|
|
Loading…
Reference in New Issue