OSDN Git Service

Fix xabspath when last path component exists but we haven't got permissions to open...
authorRob Landley <rob@landley.net>
Mon, 29 Apr 2013 17:30:28 +0000 (12:30 -0500)
committerRob Landley <rob@landley.net>
Mon, 29 Apr 2013 17:30:28 +0000 (12:30 -0500)
lib/lib.c

index b89f2db..1066ef9 100644 (file)
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -393,6 +393,7 @@ char *xabspath(char *path, int exact)
         if ((exact || todo) && errno != EINVAL) goto error;
         new->next = done;
         done = new;
+        if (errno == EINVAL && !todo) break;
         s = new->str;
       }
       fd = openat(dirfd, s, 0);