diff options
| author | iceyrazor <iceyrazor@mailfence.com> | 2026-03-06 23:01:30 -0600 |
|---|---|---|
| committer | iceyrazor <iceyrazor@mailfence.com> | 2026-03-06 23:01:30 -0600 |
| commit | ccf51927cbe96442c8801ff2682dd1039eb30053 (patch) | |
| tree | 3bbaeecaad38d198de4a98e3f037cf0289a1173d /src | |
| parent | f3d03e71ede8e94e7137777ab5ad5570c3d11b31 (diff) | |
fixed realpath
Diffstat (limited to 'src')
| -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 |
