*/
#include <common.h>
+#include <linux/ctype.h>
DECLARE_GLOBAL_DATA_PTR;
nn++;
}
- while (*nn == ' ' || *nn == '\t')
+ while (isblank(*nn))
nn++;
if ((nnl = strlen (nn)) == 0) {
nn[--nnl] = '\0';
}
- while (nnl > 0 && ((c = nn[nnl - 1]) == ' ' || c == '\t'))
+ while (nnl > 0 && isblank(nn[nnl - 1]))
nn[--nnl] = '\0';
if (nnl == 0) {
printf ("Empty name in global env file\n");
p = (char *)value;
q = nv;
- while ((c = *p) == ' ' || c == '\t')
+ while (isblank(*p))
p++;
nvl = strlen (p);
- while (nvl > 0 && ((c = p[nvl - 1]) == ' ' || c == '\t'))
+ while (nvl > 0 && isblank(p[nvl - 1]))
p[--nvl] = '\0';
while ((*q = *p++) != '\0') {
#include <common.h>
#include <command.h>
+#include <linux/ctype.h>
/*
* Use puts() instead of printf() to avoid printf buffer overflow
static char tmp_buf[512];
int space;
- space = last_char == '\0' || last_char == ' ' || last_char == '\t';
+ space = last_char == '\0' || isblank(last_char);
if (space && argc == 1)
return env_complete("", maxv, cmdv, sizeof(tmp_buf), tmp_buf);
}
/* more than one arg or one but the start of the next */
- if (argc > 1 || (last_char == '\0' || last_char == ' ' || last_char == '\t')) {
+ if (argc > 1 || (last_char == '\0' || isblank(last_char))) {
cmdtp = find_cmd(argv[0]);
if (cmdtp == NULL || cmdtp->complete == NULL) {
cmdv[0] = NULL;
while (argc < argvsz - 1) {
/* skip any white space */
- while ((*s == ' ') || (*s == '\t'))
+ while (isblank(*s))
++s;
if (*s == '\0') /* end of s, no more args */
argv[argc++] = s; /* begin of argument string */
/* find end of string */
- while (*s && (*s != ' ') && (*s != '\t'))
+ while (*s && !isblank(*s))
++s;
if (*s == '\0') /* end of s, no more args */
#endif
#include <post.h>
+#include <linux/ctype.h>
#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
DECLARE_GLOBAL_DATA_PTR;
while (nargs < CONFIG_SYS_MAXARGS) {
/* skip any white space */
- while ((*line == ' ') || (*line == '\t'))
+ while (isblank(*line))
++line;
if (*line == '\0') { /* end of line, no more args */
argv[nargs++] = line; /* begin of argument string */
/* find end of string */
- while (*line && (*line != ' ') && (*line != '\t'))
+ while (*line && !isblank(*line))
++line;
if (*line == '\0') { /* end of line, no more args */
#include <stdarg.h>
#include <common.h>
+#include <linux/ctype.h>
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
int cmd;
*n = 0;
- while (*s == ' ' || *s == '\t')
+ while (isblank(*s))
s++;
ps[*n] = *s;
switch (*s) {
}
while (1) {
- while (*s != ' ' && *s != '\t' && *s != '\n')
+ while (!isblank(*s) && *s != '\n')
s++;
if (*s == '\n')
return cmd;
- while (*s == ' ' || *s == '\t')
+ while (isblank(*s))
s++;
*n += 1;
#include <common.h>
#include <exports.h>
+#include <linux/ctype.h>
#include "../drivers/net/smc911x.h"
/**
*/
static char *skip_space(char *buf)
{
- while (buf[0] == ' ' || buf[0] == '\t')
+ while (isblank(buf[0]))
++buf;
return buf;
}
continue;
/* Only accept 1 letter commands */
- if (line[0] && line[1] && line[1] != ' ' && line[1] != '\t')
+ if (line[0] && line[1] && !isblank(line[1]))
goto unknown_cmd;
/* Now parse the command */
#ifdef USE_HOSTCC /* HOST build */
# include <string.h>
# include <assert.h>
+# include <ctype.h>
# ifndef debug
# ifdef DEBUG
#else /* U-Boot build */
# include <common.h>
# include <linux/string.h>
+# include <linux/ctype.h>
#endif
#ifndef CONFIG_ENV_MIN_ENTRIES /* minimum number of entries */
ENTRY e, *rv;
/* skip leading white space */
- while ((*dp == ' ') || (*dp == '\t'))
+ while (isblank(*dp))
++dp;
/* skip comment lines */