diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/msh.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/shell/msh.c b/shell/msh.c index 41f4cc60d..d9dd3efb2 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -1191,23 +1191,22 @@ static int isassign(const char *s) | |||
1191 | unsigned char c; | 1191 | unsigned char c; |
1192 | DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s)); | 1192 | DBGPRINTF7(("ISASSIGN: enter, s=%s\n", s)); |
1193 | 1193 | ||
1194 | /* no isalpha() - we shouldn't use locale */ | ||
1195 | c = *s; | 1194 | c = *s; |
1196 | if (c != '_' | 1195 | /* no isalpha() - we shouldn't use locale */ |
1197 | && (unsigned)((c|0x20) - 'a') > 25 /* not letter */ | 1196 | /* c | 0x20 - lowercase (Latin) letters */ |
1198 | ) { | 1197 | if (c != '_' && (unsigned)((c|0x20) - 'a') > 25) |
1198 | /* not letter */ | ||
1199 | return 0; | 1199 | return 0; |
1200 | } | 1200 | |
1201 | while (1) { | 1201 | while (1) { |
1202 | c = *++s; | 1202 | c = *++s; |
1203 | if (c == '\0') | ||
1204 | return 0; | ||
1205 | if (c == '=') | 1203 | if (c == '=') |
1206 | return 1; | 1204 | return 1; |
1207 | c |= 0x20; /* lowercase letters, doesn't affect numbers */ | 1205 | if (c == '\0') |
1206 | return 0; | ||
1208 | if (c != '_' | 1207 | if (c != '_' |
1209 | && (unsigned)(c - '0') > 9 /* not number */ | 1208 | && (unsigned)(c - '0') > 9 /* not number */ |
1210 | && (unsigned)(c - 'a') > 25 /* not letter */ | 1209 | && (unsigned)((c|0x20) - 'a') > 25 /* not letter */ |
1211 | ) { | 1210 | ) { |
1212 | return 0; | 1211 | return 0; |
1213 | } | 1212 | } |