aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2012-01-11 09:34:16 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2012-01-11 09:34:16 +0200
commit87633176610f86df377de7362ebb081394815733 (patch)
treeb5f05dd66b706344b7b79599c6f1030525dab0c1 /libgfortran
parentef1ed13d9ab2e2c9dacdb5ae06afb86ca6ad7193 (diff)
downloadgcc-87633176610f86df377de7362ebb081394815733.zip
gcc-87633176610f86df377de7362ebb081394815733.tar.gz
gcc-87633176610f86df377de7362ebb081394815733.tar.bz2
PR 51803 Handle getcwd failure and lack of the function better.
2012-01-11 Janne Blomqvist <jb@gcc.gnu.org> Mike Stump <mikestump@comcast.net> PR libfortran/51803 * runtime/main.c (store_exe_path): Handle getcwd failure and lack of the function better. Co-Authored-By: Mike Stump <mikestump@comcast.net> From-SVN: r183090
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/runtime/main.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index e82d442..3e27ed9 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-11 Janne Blomqvist <jb@gcc.gnu.org>
+ Mike Stump <mikestump@comcast.net>
+ PR libfortran/51803
+ * runtime/main.c (store_exe_path): Handle getcwd failure and lack
+ of the function better.
+
2012-01-10 Tobias Burnus <burnus@net-b.de>
PR fortran/51197
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c
index 11b535a..1cad5ef 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