*/
#include <common.h>
+#include <linux/ctype.h>
+
+DECLARE_GLOBAL_DATA_PTR;
/* imports from fetch.c */
extern int fetch_and_parse (char *, ulong, int (*)(uchar *, uchar *));
static int
env_callback (uchar *name, uchar *value)
{
- DECLARE_GLOBAL_DATA_PTR;
-
hymod_conf_t *cp = &gd->bd->bi_hymod_conf;
- char ov[CFG_CBSIZE], nv[CFG_CBSIZE], *p, *q, *nn, c, *curver, *newver;
+ char ov[CONFIG_SYS_CBSIZE], nv[CONFIG_SYS_CBSIZE], *p, *q, *nn, c, *curver, *newver;
int override = 1, append = 0, remove = 0, nnl, ovl, nvl;
nn = (char *)name;
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') {
if ((path = getenv ("global_env_path")) == NULL || *path == '\0')
path = def_global_env_path;
- if (fetch_and_parse (path, CFG_LOAD_ADDR, env_callback) == 0) {
+ if (fetch_and_parse (path, CONFIG_SYS_LOAD_ADDR, env_callback) == 0) {
puts ("*** Fetch of global environment failed!\n");
return;
}