compiles and works
This commit is contained in:
30
bs/args.c
30
bs/args.c
@@ -74,18 +74,18 @@
|
||||
// return EXIT_SUCCESS;
|
||||
// }
|
||||
|
||||
void parse_command(char *line, int *argc, char **argv) {
|
||||
*argc = 0;
|
||||
while (*line != '\0') {
|
||||
while (*line == ' ' || *line == '\t' || *line == '\n') {
|
||||
*line++ = '\0';
|
||||
}
|
||||
if (*argc >= MAX_ARGS) break;
|
||||
(*argc)++;
|
||||
*argv++ = line;
|
||||
while (*line != '\0' && *line != ' ' && *line != '\t' && *line != '\n') {
|
||||
line++;
|
||||
}
|
||||
}
|
||||
*argv = '\0';
|
||||
}
|
||||
// void parse_command(char *line, int *argc, char **argv) {
|
||||
// *argc = 0;
|
||||
// while (*line != '\0') {
|
||||
// while (*line == ' ' || *line == '\t' || *line == '\n') {
|
||||
// *line++ = '\0';
|
||||
// }
|
||||
// if (*argc >= MAX_ARGS) break;
|
||||
// (*argc)++;
|
||||
// *argv++ = line;
|
||||
// while (*line != '\0' && *line != ' ' && *line != '\t' && *line != '\n') {
|
||||
// line++;
|
||||
// }
|
||||
// }
|
||||
// *argv = '\0';
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user