if ( cursor ) {
int prevcursor = cursor;
- while ( cursor && (cmdline[cursor-1] <= ' ') )
+ while ( cursor && my_isspace(cmdline[cursor-1]) )
cursor--;
- while ( cursor && (cmdline[cursor-1] > ' ') )
+ while ( cursor && !my_isspace(cmdline[cursor-1]) )
cursor--;
memmove(cmdline+cursor, cmdline+prevcursor, len-prevcursor+1);
kernel = q;
p = cmdline;
- while ( *p && *p > ' ' ) {
+ while ( *p && !my_isspace(*p) ) {
*q++ = *p++;
}
*q++ = '\0';
args = q;
- while ( *p && *p <= ' ' )
+ while ( *p && my_isspace(*p) )
p++;
strcpy(q, p);
void parse_config(const char *filename);
+static inline int my_isspace(char c)
+{
+ return (unsigned char)c <= ' ';
+}
+
#endif /* MENU_H */
static char *
skipspace(char *p)
{
- while ( *p && *p <= ' ' )
+ while ( *p && my_isspace(*p) )
p++;
return p;
if ( *q )
return NULL; /* Didn't see the keyword */
- return (*p <= ' ') ? p : NULL; /* Must be EOL or whitespace */
+ return my_isspace(*p) ? p : NULL; /* Must be EOL or whitespace */
}
struct labeldata {
int i, pos;
p = str;
- while ( *p && !isspace(*p) )
+ while ( *p && !my_isspace(*p) )
p++;
/* p now points to the first byte beyond the kernel name */
pos = p-str;
for ( i = 0 ; i < nentries ; i++ ) {
- me = &menu_entry[i];
+ me = &menu_entries[i];
if ( !strncmp(str, me->label, pos) && !me->label[pos] ) {
/* Found matching label */