1
0
Fork 0

Be a bit more flexible. Parse ver set 3.2 correctly as well.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3964
This commit is contained in:
Peter Veenstra 2016-02-10 09:42:32 +00:00
parent 7de4631055
commit 3000bd2feb

View file

@ -1235,7 +1235,16 @@ void DOS_Shell::CMD_VER(char *args) {
char* word = StripWord(args);
if(strcasecmp(word,"set")) return;
word = StripWord(args);
dos.version.major = (Bit8u)(atoi(word));
dos.version.minor = (Bit8u)(atoi(args));
if (!*args && !*word) { //Reset
dos.version.major = 5;
dos.version.minor = 0;
} else if (*args == 0 && *word && (strchr(word,'.') != 0)) { //Allow: ver set 5.1
const char * p = strchr(word,'.');
dos.version.major = (Bit8u)(atoi(word));
dos.version.minor = (Bit8u)(atoi(p+1));
} else { //Official syntax: ver set 5 2
dos.version.major = (Bit8u)(atoi(word));
dos.version.minor = (Bit8u)(atoi(args));
}
} else WriteOut(MSG_Get("SHELL_CMD_VER_VER"),VERSION,dos.version.major,dos.version.minor);
}