[ros-diffs] [cwittich] 32073: fix a bug in goto a stubs for setlocal and endlocal (our default is delayed expansion)

cwittich at svn.reactos.org cwittich at svn.reactos.org
Fri Feb 1 10:49:59 CET 2008


Author: cwittich
Date: Fri Feb  1 12:49:58 2008
New Revision: 32073

URL: http://svn.reactos.org/svn/reactos?rev=32073&view=rev
Log:
fix a bug in goto
a stubs for setlocal and endlocal (our default is delayed expansion)

Added:
    trunk/reactos/base/shell/cmd/setlocal.c   (with props)
Modified:
    trunk/reactos/base/shell/cmd/cmd.h
    trunk/reactos/base/shell/cmd/cmd.rbuild
    trunk/reactos/base/shell/cmd/cmdtable.c
    trunk/reactos/base/shell/cmd/goto.c

Modified: trunk/reactos/base/shell/cmd/cmd.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.h?rev=32073&r1=32072&r2=32073&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.h (original)
+++ trunk/reactos/base/shell/cmd/cmd.h Fri Feb  1 12:49:58 2008
@@ -361,6 +361,9 @@
 /* Prototypes for SET.C */
 INT cmd_set (LPTSTR, LPTSTR);
 
+/* Prototypes for SETLOCAL.C */
+INT cmd_setlocal (LPTSTR, LPTSTR);
+INT cmd_endlocal (LPTSTR, LPTSTR);
 
 /* Prototypes for START.C */
 INT cmd_start (LPTSTR, LPTSTR);

Modified: trunk/reactos/base/shell/cmd/cmd.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.rbuild?rev=32073&r1=32072&r2=32073&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/cmd.rbuild (original)
+++ trunk/reactos/base/shell/cmd/cmd.rbuild Fri Feb  1 12:49:58 2008
@@ -54,6 +54,7 @@
 			<file>replace.c</file>
 			<file>screen.c</file>
 			<file>set.c</file>
+			<file>setlocal.c</file>
 			<file>shift.c</file>
 			<file>start.c</file>
 			<file>strtoclr.c</file>

Modified: trunk/reactos/base/shell/cmd/cmdtable.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmdtable.c?rev=32073&r1=32072&r2=32073&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/cmdtable.c (original)
+++ trunk/reactos/base/shell/cmd/cmdtable.c Fri Feb  1 12:49:58 2008
@@ -100,6 +100,8 @@
 	{_T("echoerr."), CMD_HIDE, CommandEchoerr},
 	{_T("echoserr"), 0, CommandEchoserr},
 
+	{_T("endlocal"), 0, cmd_endlocal},
+
 #ifdef INCLUDE_CMD_DEL
 	{_T("erase"), 0, CommandDelete},
 #endif
@@ -191,6 +193,8 @@
 #ifdef INCLUDE_CMD_SET
 	{_T("set"), 0, cmd_set},
 #endif
+
+	{_T("setlocal"), 0, cmd_setlocal},
 
 	{_T("shift"), CMD_BATCHONLY, cmd_shift},
 

Modified: trunk/reactos/base/shell/cmd/goto.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/goto.c?rev=32073&r1=32072&r2=32073&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/goto.c (original)
+++ trunk/reactos/base/shell/cmd/goto.c Fri Feb  1 12:49:58 2008
@@ -39,7 +39,7 @@
 INT cmd_goto (LPTSTR cmd, LPTSTR param)
 {
 	TCHAR szMsg[RC_STRING_MAX_SIZE];
-	LPTSTR tmp;
+	LPTSTR tmp, tmp2;
 	LONG   lNewPosHigh = 0;
 
 #ifdef _DEBUG
@@ -119,8 +119,9 @@
 			pos++;
 		}
 
+		tmp2 = param;
 		/* use whole label name */
-		if ((*tmp == _T(':')) && ((_tcsicmp (++tmp, param) == 0) || (_tcsicmp (tmp, ++param) == 0)))
+		if ((*tmp == _T(':')) && ((_tcsicmp (++tmp, param) == 0) || (_tcsicmp (tmp, ++tmp2) == 0)))
 			return 0;
 
 	}

Added: trunk/reactos/base/shell/cmd/setlocal.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/setlocal.c?rev=32073&view=auto
==============================================================================
--- trunk/reactos/base/shell/cmd/setlocal.c (added)
+++ trunk/reactos/base/shell/cmd/setlocal.c Fri Feb  1 12:49:58 2008
@@ -1,0 +1,27 @@
+/*
+ *  GOTO.C - goto internal batch command.
+ *
+ *  History:
+ *
+ *    1 Feb 2008 (Christoph von Wittich)
+ *        started.
+*/ 
+
+#include <precomp.h>
+
+
+/* unimplemented */
+
+/* our current default is delayedexpansion */
+
+INT cmd_setlocal (LPTSTR cmd, LPTSTR param)
+{
+	return 0;
+}
+
+/* endlocal doesn't take any params */
+INT cmd_endlocal (LPTSTR cmd, LPTSTR param)
+{
+	return 0;
+}
+

Propchange: trunk/reactos/base/shell/cmd/setlocal.c
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the Ros-diffs mailing list