Changeset 43e02a6 in mainline
- Timestamp:
- 2008-08-29T11:07:22Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c4f46a
- Parents:
- 3771a6e
- Location:
- uspace/app/bdsh
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/builtins/cd/cd.c
r3771a6e r43e02a6 63 63 int argc, rc = 0; 64 64 65 for (argc = 0; argv[argc] != NULL; argc ++);65 argc = cli_count_args(argv); 66 66 67 67 /* We don't yet play nice with whitespace, a getopt implementation should -
uspace/app/bdsh/cmds/modules/cat/cat.c
r3771a6e r43e02a6 139 139 int c, opt_ind; 140 140 141 for (argc = 0; argv[argc] != NULL; argc ++);141 argc = cli_count_args(argv); 142 142 143 143 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { -
uspace/app/bdsh/cmds/modules/help/help.c
r3771a6e r43e02a6 32 32 #include <stdlib.h> 33 33 #include <string.h> 34 35 #include "config.h" 34 36 #include "entry.h" 35 37 #include "help.h" … … 38 40 #include "builtins.h" 39 41 #include "errors.h" 42 #include "util.h" 40 43 41 44 static char *cmdname = "help"; … … 96 99 int level = HELP_SHORT; 97 100 98 for (argc = 0; argv[argc] != NULL; argc ++);101 argc = cli_count_args(argv); 99 102 100 103 if (argc > 3) { -
uspace/app/bdsh/cmds/modules/ls/ls.c
r3771a6e r43e02a6 153 153 DIR *dirp; 154 154 155 /* Count the arguments */ 156 for (argc = 0; argv[argc] != NULL; argc ++); 155 argc = cli_count_args(argv); 157 156 158 157 buff = (char *) malloc(PATH_MAX); -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r3771a6e r43e02a6 189 189 char *cwd; 190 190 191 for (argc = 0; argv[argc] != NULL; argc ++);191 argc = cli_count_args(argv); 192 192 193 193 for (c = 0, optind = 0, opt_ind = 0; c != -1;) { -
uspace/app/bdsh/cmds/modules/rm/rm.c
r3771a6e r43e02a6 174 174 char *buff = NULL; 175 175 176 for (argc = 0; argv[argc] != NULL; argc ++); 176 argc = cli_count_args(argv); 177 177 178 if (argc < 2) { 178 179 cli_error(CL_EFAIL, -
uspace/app/bdsh/cmds/modules/touch/touch.c
r3771a6e r43e02a6 71 71 DIR *dirp; 72 72 73 /* Count the arguments */ 74 for (argc = 0; argv[argc] != NULL; argc ++); 73 argc = cli_count_args(argv); 75 74 76 75 if (argc == 1) { -
uspace/app/bdsh/util.c
r3771a6e r43e02a6 238 238 return (cli_strtok_r(s, delim, &last)); 239 239 } 240 241 /* Count and return the # of elements in an array */ 242 unsigned int cli_count_args(char **args) 243 { 244 unsigned int i; 245 246 for (i=0; args[i] != NULL; i++); 247 return i; 248 } 249 -
uspace/app/bdsh/util.h
r3771a6e r43e02a6 8 8 extern char * cli_strtok_r(char *, const char *, char **); 9 9 extern char * cli_strtok(char *, const char *); 10 extern unsigned int cli_count_args(char **); 10 11 11 12 #endif
Note:
See TracChangeset
for help on using the changeset viewer.