Message ID | 4F0D424F.4030808@net-b.de |
---|---|
State | New |
Headers | show |
--- a/libgfortran/runtime/main.c +++ b/libgfortran/runtime/main.c @@ -117,9 +117,16 @@ store_exe_path (const char * argv0) #ifdef HAVE_GETCWD cwd = getcwd (buf, sizeof (buf)); #else - cwd = ""; + cwd = NULL; #endif + if (cwd == NULL) + { + exe_path = argv0; + please_free_exe_path_when_done = 0; + return; + } + /* exe_path will be cwd + "/" + argv[0] + "\0". This will not work if the executable is not in the cwd, but at this point we're out of better ideas. */