/trunk/uspace/app/bdsh/input.c |
---|
146,7 → 146,6 |
void get_input(cliuser_t *usr) |
{ |
char line[INPUT_MAX]; |
size_t len = 0; |
console_set_style(STYLE_EMPHASIS); |
printf("%s", usr->prompt); |
153,9 → 152,8 |
console_set_style(STYLE_NORMAL); |
read_line(line, INPUT_MAX); |
len = strlen(line); |
/* Make sure we don't have rubbish or a C/R happy user */ |
if (len == 0 || line[0] == '\n') |
if (str_cmp(line, "") == 0 || str_cmp(line, "\n") == 0) |
return; |
usr->line = strdup(line); |
/trunk/uspace/app/bdsh/cmds/mod_cmds.c |
---|
64,7 → 64,7 |
return -2; |
for (mod = modules; mod->name != NULL; mod++, i++) { |
if (!strcmp(mod->name, command)) |
if (!str_cmp(mod->name, command)) |
return i; |
} |
81,7 → 81,7 |
return -1; |
for(i=0; mod_aliases[i] != NULL; i+=2) { |
if (!strcmp(mod_aliases[i], command)) |
if (!str_cmp(mod_aliases[i], command)) |
return 1; |
} |
97,7 → 97,7 |
return (char *)NULL; |
for(i=0; mod_aliases[i] != NULL; i++) { |
if (!strcmp(mod_aliases[i], command)) |
if (!str_cmp(mod_aliases[i], command)) |
return (char *)mod_aliases[++i]; |
i++; |
} |
/trunk/uspace/app/bdsh/cmds/modules/mkdir/mkdir.c |
---|
149,7 → 149,7 |
while (dirs[i] != NULL) { |
/* Sometimes make or scripts conjoin odd paths. Account for something |
* like this: ../../foo/bar/../foo/foofoo/./bar */ |
if (!strcmp(dirs[i], "..") || !strcmp(dirs[i], ".")) { |
if (!str_cmp(dirs[i], "..") || !str_cmp(dirs[i], ".")) { |
if (0 != (chdir(dirs[i]))) { |
cli_error(CL_EFAIL, "%s: impossible path: %s", |
cmdname, path); |
/trunk/uspace/app/bdsh/cmds/modules/help/help.c |
---|
107,7 → 107,7 |
} |
if (argc == 3) { |
if (!strcmp("extended", argv[2])) |
if (!str_cmp("extended", argv[2])) |
level = HELP_LONG; |
else |
level = HELP_SHORT; |
/trunk/uspace/app/bdsh/cmds/modules/rm/rm.c |
---|
216,7 → 216,7 |
i = optind; |
while (NULL != argv[i]) { |
len = strlen(argv[i]) + 2; |
len = str_size(argv[i]) + 2; |
buff = (char *) realloc(buff, len); |
if (buff == NULL) { |
printf("rm: out of memory\n"); |
/trunk/uspace/app/bdsh/cmds/builtin_cmds.c |
---|
49,7 → 49,7 |
return -2; |
for (cmd = builtins; cmd->name != NULL; cmd++, i++) { |
if (!strcmp(cmd->name, command)) |
if (!str_cmp(cmd->name, command)) |
return i; |
} |
64,7 → 64,7 |
return -1; |
for(i=0; builtin_aliases[i] != NULL; i+=2) { |
if (!strcmp(builtin_aliases[i], command)) |
if (!str_cmp(builtin_aliases[i], command)) |
return 1; |
} |
79,7 → 79,7 |
return (char *)NULL; |
for(i=0; builtin_aliases[i] != NULL; i++) { |
if (!strcmp(builtin_aliases[i], command)) |
if (!str_cmp(builtin_aliases[i], command)) |
return (char *)builtin_aliases[++i]; |
i++; |
} |
/trunk/uspace/app/bdsh/exec.c |
---|
71,7 → 71,7 |
char *path_tok; |
char *path[PATH_MAX]; |
int n = 0, i = 0; |
size_t x = strlen(cmd) + 2; |
size_t x = str_size(cmd) + 2; |
found = (char *)malloc(PATH_MAX); |
85,7 → 85,7 |
/* Extract the PATH env to a path[] array */ |
path[n] = strtok(path_tok, PATH_DELIM); |
while (NULL != path[n]) { |
if ((strlen(path[n]) + x ) > PATH_MAX) { |
if ((str_size(path[n]) + x ) > PATH_MAX) { |
cli_error(CL_ENOTSUP, |
"Segment %d of path is too large, search ends at segment %d", |
n, n-1); |