diff options
Diffstat (limited to 'src/main.c')
| -rwxr-xr-x | src/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -59,8 +59,7 @@ static char* call_realpath (char * argv0) { if (realpath (argv0, resolved_path) == 0) { fprintf (stderr, "lsh: realpath failed: %s\n", strerror (errno)); exit(errno); - } - else { + } else { return resolved_path; } } @@ -75,7 +74,8 @@ int main(int argc, char **argv){ setenv("SHLVL",shlvl,1); } - char* prog_path = call_realpath(argv[0]); + //remove this if you dont care about SHELL var being set + char* prog_path = call_realpath("/proc/self/exe"); setenv("SHELL",prog_path,1); //Set The prompt |
