aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriceyrazor <iceyrazor@mailfence.com>2026-03-06 23:01:30 -0600
committericeyrazor <iceyrazor@mailfence.com>2026-03-06 23:01:30 -0600
commitccf51927cbe96442c8801ff2682dd1039eb30053 (patch)
tree3bbaeecaad38d198de4a98e3f037cf0289a1173d
parentf3d03e71ede8e94e7137777ab5ad5570c3d11b31 (diff)
fixed realpath
-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