* toplev.c (get_src_pwd): Handle failure of getpwd().
authorGeoffrey Keating <geoffk@apple.com>
Tue, 4 Jan 2005 23:28:00 +0000 (23:28 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Tue, 4 Jan 2005 23:28:00 +0000 (23:28 +0000)
From-SVN: r92910

gcc/ChangeLog
gcc/toplev.c

index 96b0483a8f930298df844fb29b87ad9e60f3c1aa..fa18be5c8b9a307175ef82dfbf120a24d2a61b5a 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-04  Geoffrey Keating  <geoffk@apple.com>
+
+       * toplev.c (get_src_pwd): Handle failure of getpwd().
+
 2005-01-04  Roger Sayle  <roger@eyesopen.com>
 
        * fold-const.c (fold_single_bit_test): Delete unreachable handling
index 5a5702f0de2e5b5392283f5c8b0e087ab440948f..c403b110fd29a4426a5d30298039fecdc5e2b988 100644 (file)
@@ -449,7 +449,11 @@ const char *
 get_src_pwd (void)
 {
   if (! src_pwd)
-    src_pwd = getpwd ();
+    {
+      src_pwd = getpwd ();
+      if (!src_pwd)
+       src_pwd = ".";
+    }
 
    return src_pwd;
 }