OSDN Git Service

* toplev.c (get_src_pwd): Handle failure of getpwd().
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2005 23:28:00 +0000 (23:28 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Jan 2005 23:28:00 +0000 (23:28 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92910 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/toplev.c

index 96b0483..fa18be5 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 5a5702f..c403b11 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;
 }