From c37b2c2eee902865f23face7726e6a42ed6ec89d Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 15 May 2007 18:55:23 +0000 Subject: [PATCH] Fix an old bug in goto that prevented having the else on the same line. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2856 --- src/shell/shell_cmds.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index 5c020a21..a7bee72a 100644 --- a/src/shell/shell_cmds.cpp +++ b/src/shell/shell_cmds.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell_cmds.cpp,v 1.73 2007-01-21 16:18:12 qbix79 Exp $ */ +/* $Id: shell_cmds.cpp,v 1.74 2007-05-15 18:55:23 qbix79 Exp $ */ #include #include @@ -742,6 +742,13 @@ void DOS_Shell::CMD_GOTO(char * args) { StripSpaces(args); if (!bf) return; if (*args &&(*args==':')) args++; + //label ends at the first space + char* non_space = args; + while (*non_space) { + if((*non_space == ' ') || (*non_space == '\t')) + *non_space = 0; + else non_space++; + } if (!*args) { WriteOut(MSG_Get("SHELL_CMD_GOTO_MISSING_LABEL")); return;