Skip to content

Commit 4ffc5c1

Browse files
committed
fix bug#121 don't look for 123? unless still looking for verb at start of line
allows correctly parsing lines like SHELL=4DOS.COM which otherwise strips 4 leading to looking for shell of "DOS.COM"
1 parent f7bf549 commit 4ffc5c1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

kernel/config.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ STATIC VOID DoMenu(void);
213213
STATIC VOID CfgMenuDefault(BYTE * pLine);
214214
STATIC BYTE * skipwh(BYTE * s);
215215
STATIC int iswh(unsigned char c);
216-
STATIC BYTE * scan(BYTE * s, BYTE * d);
216+
STATIC BYTE * scan(BYTE * s, BYTE * d, int fMenuSelect);
217217
STATIC BOOL isnum(char ch);
218218
#if 0
219219
STATIC COUNT tolower(COUNT c);
@@ -978,7 +978,7 @@ VOID DoConfig(int nPass)
978978
DebugPrintf(("CONFIG=[%s]\n", szLine));
979979

980980
/* Skip leading white space and get verb. */
981-
pLine = scan(szLine, szBuf);
981+
pLine = scan(szLine, szBuf, 1);
982982

983983
/* If the line was blank, skip it. Otherwise, look up */
984984
/* the verb and execute the appropriate function. */
@@ -1210,7 +1210,7 @@ STATIC char *GetNumArg(char *p, int *num)
12101210
BYTE *GetStringArg(BYTE * pLine, BYTE * pszString)
12111211
{
12121212
/* just return whatever string is there, including null */
1213-
return scan(pLine, pszString);
1213+
return scan(pLine, pszString, 0);
12141214
}
12151215

12161216
STATIC void Config_Buffers(BYTE * pLine)
@@ -2030,7 +2030,7 @@ STATIC BYTE * skipwh(BYTE * s)
20302030
return s;
20312031
}
20322032

2033-
STATIC BYTE * scan(BYTE * s, BYTE * d)
2033+
STATIC BYTE * scan(BYTE * s, BYTE * d, int fMenuSelect)
20342034
{
20352035
askThisSingleCommand = FALSE;
20362036
DontAskThisSingleCommand = FALSE;
@@ -2039,9 +2039,12 @@ STATIC BYTE * scan(BYTE * s, BYTE * d)
20392039

20402040
MenuLine = 0;
20412041

2042+
/* only check at beginning of line, ie when looking for
2043+
menu selection line applies to. Fixes issue where
2044+
value after = starts with number, eg shell=4dos */
20422045
/* does the line start with "123?" */
20432046

2044-
if (isnum(*s))
2047+
if (fMenuSelect && isnum(*s))
20452048
{
20462049
unsigned numbers = 0;
20472050
for ( ; isnum(*s); s++)

0 commit comments

Comments
 (0)