Thumbnail

rani/cscroll.git

Clone URL: https://git.buni.party/rani/cscroll.git

commit 22003a57aeccde5c63024a36f9cb71b8dfa24f3e Author: Raniconduh <clagv.randomgames@gmail.com> Date: Tue Oct 12 09:24:15 2021 +0000 convert relative paths passed to argv into absolute paths diff --git a/src/main.c b/src/main.c index 04bac56..0e3ebdd 100644 --- a/src/main.c +++ b/src/main.c @@ -158 +157 @@ int main(int argc, char ** argv) {   if (!strcmp(argv[i], "-p")) {   print_path = true;   } else { - cwd = malloc(strlen(argv[i]) + 2); - strcpy(cwd, argv[i]); + cwd = realpath(argv[1], NULL);   setenv("PWD", cwd, true);   }   }