aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index ef88291..443ca2f 100755
--- a/src/main.c
+++ b/src/main.c
@@ -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