make the output visually pleasing.
Modified: trunk/reactos/subsys/system/cmd/seta_test.cmd
_____
Modified: trunk/reactos/subsys/system/cmd/seta_test.cmd
--- trunk/reactos/subsys/system/cmd/seta_test.cmd 2005-11-06
16:11:01 UTC (rev 19028)
+++ trunk/reactos/subsys/system/cmd/seta_test.cmd 2005-11-06
17:58:08 UTC (rev 19029)
@@ -1,4 +1,4 @@
-@rem echo off
+@echo off
@rem the next line reexecutes the script without params if it was
called with params, else we'll get false failures
@if not "%1"=="" seta_test.cmd
@@ -11,74 +11,106 @@
if "1"=="2" goto failure
if not "1"=="1" goto failure
set /a a=1
+echo.
if not "%a%"=="1" goto failure
set /a b=a
+echo.
if not "%b%"=="1" goto failure
set /a a=!5
+echo.
if not "%a%"=="0" goto failure
set /a a=!a
+echo.
if not "%a%"=="1" goto failure
set /a a=~5
+echo.
if not "%a%"=="-6" goto failure
set /a a=5,a=-a
+echo.
if not "%a%"=="-5" goto failure
set /a a=5*7
+echo.
if not "%a%"=="35" goto failure
set /a a=2000/10
+echo.
if not "%a%"=="200" goto failure
set /a a=42%%9
+echo.
if not "%a%"=="6" goto failure
set /a a=5%2
+echo.
if not "%a%"=="5" goto failure
set /a a=42^%13
+echo.
if not "%a%"=="423" goto failure
set /a a=7+9
+echo.
if not "%a%"=="16" goto failure
set /a a=9-7
+echo.
if not "%a%"=="2" goto failure
set /a a=9^<^<2
+echo.
if not "%a%"=="36" goto failure
set /a a=36^>^>2
+echo.
if not "%a%"=="9" goto failure
set /a a=42^&9
+echo.
if not "%a%"=="8" goto failure
set /a a=32^9
+echo.
if not "%a%"=="329" goto failure
set /a a=32^^9
+echo.
if not "%a%"=="41" goto failure
set /a a=10^|22
+echo.
if not "%a%"=="30" goto failure
set /a a=2,a*=3
+echo.
if not "%a%"=="6" goto failure
set /a a=11,a/=2
+echo.
if not "%a%"=="5" goto failure
set /a a=42,a%%=9
+echo.
if not "%a%"=="6" goto failure
set /a a=7,a+=9
+echo.
if not "%a%"=="16" goto failure
set /a a=9,a-=7
+echo.
if not "%a%"=="2" goto failure
set /a a=42,a^&=9
+echo.
if not "%a%"=="8" goto failure
set /a a=32,a^^=9
+echo.
if not "%a%"=="41" goto failure
set /a a=10,a^|=22
+echo.
if not "%a%"=="30" goto failure
set /a a=9,a^<^<=2
+echo.
if not "%a%"=="36" goto failure
set /a a=36,a^>^>=2
+echo.
if not "%a%"=="9" goto failure
set /a a=1,2
+echo.
if not "%a%"=="1" goto failure
set /a a=(a=1,a+2)
+echo.
if "%a%"=="3" goto success
goto failure
:success
echo SUCCESS!
+echo.
goto done
:failure
echo FAILURE! remove the echo off and see the last formula that
executed before this line
-
+echo.
:done
%foo% where foo is not a envir var should be returned as %foo% not as
"".
Modified: trunk/reactos/subsys/system/cmd/cmd.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-11-06 13:30:42 UTC
(rev 19027)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-11-06 16:11:01 UTC
(rev 19028)
@@ -1175,7 +1175,9 @@
return ret;
}
- return _T(""); /* not found - return empty string */
+ GrowIfNecessary(_tcslen(varName) + 2, &ret, &retlen);
+ _stprintf(ret,_T("%%%s%%"),varName);
+ return ret; /* not found - return orginal string */
}
LPCTSTR