]> arthur.barton.de Git - netatalk.git/commitdiff
Add slash at start of loop, not at the end
authorFrank Lahm <franklahm@googlemail.com>
Fri, 29 Apr 2011 08:23:47 +0000 (10:23 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 29 Apr 2011 08:23:47 +0000 (10:23 +0200)
etc/afpd/directory.c

index b981af66c03fb6c4b94cff562402dcc78dbcd13d..9d5cf44065cefeffb6d5ba82394f3563a9bcdf50 100644 (file)
@@ -468,6 +468,7 @@ struct dir *dirlookup_bypath(const struct vol *vol, const char *path)
     l = bsplit(rpath, '/');
     for (int i = 0; i < l->qty ; i++) {                  /* 3. */
         did = cnid;
+        EC_ZERO(bcatcstr(statpath, "/"));
         EC_ZERO(bconcat(statpath, l->entry[i]));
         EC_ZERO_LOGSTR(lstat(cfrombstr(statpath), &st),
                        "lstat(rpath: %s, elem: %s): %s: %s",
@@ -494,8 +495,6 @@ struct dir *dirlookup_bypath(const struct vol *vol, const char *path)
             if ((dir = dirlookup(vol, cnid)) == NULL) /* 7. */
                 EC_FAIL;
         }
-
-        EC_ZERO(bcatcstr(statpath, "/"));
     }
 
 EC_CLEANUP: