summaryrefslogtreecommitdiff
path: root/libgfortran/runtime/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgfortran/runtime/main.c')
-rw-r--r--libgfortran/runtime/main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c
index 11b535afa92..1cad5eff725 100644
--- a/libgfortran/runtime/main.c
+++ b/libgfortran/runtime/main.c
@@ -116,8 +116,10 @@ store_exe_path (const char * argv0)
memset (buf, 0, sizeof (buf));
#ifdef HAVE_GETCWD
cwd = getcwd (buf, sizeof (buf));
+ if (!cwd)
+ cwd = ".";
#else
- cwd = "";
+ cwd = ".";
#endif
/* exe_path will be cwd + "/" + argv[0] + "\0". This will not work