]> git.wh0rd.org - dump.git/blobdiff - restore/symtab.c
Fix restore -C to handle correctly directories containing a file with the same name...
[dump.git] / restore / symtab.c
index 8cd384c51dd36a7f2ba622f75f0214bdf93fd268..4a2e1abe969d5053c91864a16f93a635ede683cf 100644 (file)
@@ -37,7 +37,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: symtab.c,v 1.23 2004/12/14 14:07:58 stelian Exp $";
+       "$Id: symtab.c,v 1.24 2005/01/14 13:04:07 stelian Exp $";
 #endif /* not lint */
 
 /*
@@ -189,9 +189,16 @@ lookupname(char *name)
        char *np, *cp;
        char buf[MAXPATHLEN];
 
+       ep = lookupino(ROOTINO);
+
        cp = name;
+       if (*cp == '.')
+               ++cp;
+       if (*cp == '/')
+               ++cp;
+       if (*cp == '\0')
+               return ep;
 
-       ep = lookupino(ROOTINO);
        while (ep != NULL) {
                for (np = buf; *cp != '/' && *cp != '\0' &&
                                np < &buf[sizeof(buf)]; )
@@ -202,8 +209,7 @@ lookupname(char *name)
 
                oldep = ep;
 
-               if (strcmp(ep->e_name, buf) != 0 &&
-                   ep->e_entries != NULL) {
+               if (ep->e_entries != NULL) {
 
                        ep = ep->e_entries[dir_hash(buf)];
                        for ( ; ep != NULL; ep = ep->e_sibling)