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:
parent
7de4631055
commit
3000bd2feb
1 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue