Skip to content

Commit

Permalink
/bin/ls is working with spaces and no leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kelliemogg committed Nov 25, 2020
1 parent 041b161 commit ad76c81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dir_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ char *dir_search(char **argv, char **path_tokens)
char *asdf = NULL;
char *store = NULL;

if (argv[0][0] == '/')
return(argv[0]);
for (i = 0; path_tokens[i] != '\0'; i++)
{
deer = opendir(path_tokens[i]);
Expand Down
1 change: 0 additions & 1 deletion shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ int shell_loop(int argc, char **argv)
function_finder(argv[0], args_list);
path_tokens = _get_env("PATH");
executable = dir_search(argv, path_tokens);
/*dubbie_free(path_tokens);*/
executor(executable, argv);
dubbie_free(path_tokens);
/*free(argv);*/
Expand Down

0 comments on commit ad76c81

Please sign in to comment.