msvc6 warning fix
Modified: trunk/reactos/subsys/system/cmd/dir.c
_____
Modified: trunk/reactos/subsys/system/cmd/dir.c
--- trunk/reactos/subsys/system/cmd/dir.c 2005-09-21 01:27:22 UTC
(rev 17958)
+++ trunk/reactos/subsys/system/cmd/dir.c 2005-09-21 01:27:54 UTC
(rev 17959)
@@ -240,7 +240,7 @@
BOOL bPNegative; /* Negative switch parameter */
BOOL bIntoQuotes; /* A flag showing if we are in quotes (") */
LPTSTR ptrLast; /* A pointer to the last character of param */
- INT t = 0;
+ UINT t = 0;
/* Initialize variables; */
always strip '^' (unless it was preceded by an '^' itself), not just if
it precedes the redirection symbols - fixes some of my test cases in
seta_test.cmd
Modified: trunk/reactos/subsys/system/cmd/set.c
_____
Modified: trunk/reactos/subsys/system/cmd/set.c
--- trunk/reactos/subsys/system/cmd/set.c 2005-09-21 01:25:58 UTC
(rev 17957)
+++ trunk/reactos/subsys/system/cmd/set.c 2005-09-21 01:27:22 UTC
(rev 17958)
@@ -69,7 +69,7 @@
/* remove escapes */
if ( param[0] ) for ( i = 0; param[i+1]; i++ )
{
- if ( param[i] == '^' && strchr("<|>&^",param[i+1]) )
+ if ( param[i] == '^' )
{
memmove ( ¶m[i], ¶m[i+1],
_tcslen(¶m[i]) * sizeof(TCHAR) );
}
a few more tests to clarify parsing oddities based on my playing around
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-09-21
01:22:56 UTC (rev 17955)
+++ trunk/reactos/subsys/system/cmd/seta_test.cmd 2005-09-21
01:23:44 UTC (rev 17956)
@@ -1,6 +1,8 @@
-@echo off
-@rem the next line illustrates a bug in our cmd
-set /a a=5%2
+@rem 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
+
@rem the next two lines illustrate bug in existing if code
if not "=="=="==" goto failure
if "=="=="==" goto next1
@@ -26,6 +28,10 @@
if not "%a%"=="200" goto failure
set /a a=42%%9
if not "%a%"=="6" goto failure
+set /a a=5%2
+if not "%a%"=="5" goto failure
+set /a a=42^%13
+if not "%a%"=="423" goto failure
set /a a=7+9
if not "%a%"=="16" goto failure
set /a a=9-7
@@ -36,6 +42,8 @@
if not "%a%"=="9" goto failure
set /a a=42^&9
if not "%a%"=="8" goto failure
+set /a a=32^9
+if not "%a%"=="329" goto failure
set /a a=32^^9
if not "%a%"=="41" goto failure
set /a a=10^|22