From 9a497f0b4b2f7a64e3e263b3a2d6447e916741d2 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Wed, 2 Mar 2005 11:53:00 +0000 Subject: [PATCH] if is always with == except for errorlevel, which accepts = as well Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2125 --- src/shell/shell_cmds.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/shell/shell_cmds.cpp b/src/shell/shell_cmds.cpp index fbbb252b..7b5223c9 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.51 2005-02-10 10:21:12 qbix79 Exp $ */ +/* $Id: shell_cmds.cpp,v 1.52 2005-03-02 11:53:00 qbix79 Exp $ */ #include #include @@ -526,9 +526,15 @@ void DOS_Shell::CMD_IF(char * args) { bool has_not=false; char * comp=strchr(args,'='); if (comp) { - if (comp[1]!='=') {SyntaxError();return;} - *comp++=' '; - *comp++=' '; + if (comp[1] == '=') { + *comp++ = ' '; + *comp++ = ' '; + } else if(strncasecmp(args,"ERRORLEVEL",10) == 0) { + /* this is in general a syntax error except for errorlevel */ + *comp++ = ' '; + while(*comp++ == ' ') + ; /*nothing */ + } else {SyntaxError();return;} }; char * word=StripWord(args); if (strcasecmp(word,"NOT")==0) {