Explorar o código

Fix xabspath() in keep symlinks mode.

Rob Landley hai 1 ano
pai
achega
838e68d574
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      lib/xwrap.c

+ 2 - 2
lib/xwrap.c

@@ -631,8 +631,8 @@ char *xabspath(char *path, int flags)
     }
 
     // Is this a symlink?
-    if (flags & (ABS_KEEP<<!todo)) errno = len = 0;
-    else len = readlinkat(dirfd, new->str, libbuf, sizeof(libbuf));
+    if (flags & (ABS_KEEP<<!todo)) len = 0, errno = EINVAL;
+    else len = readlinkat(dirfd, str, libbuf, sizeof(libbuf));
     if (len>4095) goto error;
 
     // Not a symlink: add to linked list, move dirfd, fail if error