cmd.exe: Add support for call :label and goto :label.
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 346591a..9a8b513f 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -434,6 +434,7 @@
return;
}
if (context != NULL) {
+ char *paramStart = param1;
/* Handle special :EOF label */
if (lstrcmpi (":eof", param1) == 0) {
@@ -441,9 +442,12 @@
return;
}
+ /* Support goto :label as well as goto label */
+ if (*paramStart == ':') paramStart++;
+
SetFilePointer (context -> h, 0, NULL, FILE_BEGIN);
while (WCMD_fgets (string, sizeof(string), context -> h)) {
- if ((string[0] == ':') && (lstrcmpi (&string[1], param1) == 0)) return;
+ if ((string[0] == ':') && (lstrcmpi (&string[1], paramStart) == 0)) return;
}
WCMD_output ("Target to GOTO not found\n");
}