]> git.wh0rd.org - dump.git/blobdiff - restore/symtab.c
Fix code to not require ISO C99.
[dump.git] / restore / symtab.c
index 8cd384c51dd36a7f2ba622f75f0214bdf93fd268..b69259a7fe9185986fddbe54477cac1c6ace6dfc 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.25 2005/03/30 13:34:00 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)
@@ -706,8 +712,10 @@ initsymtable(char *filename)
                panic("initsymtable called from command %c\n", command);
                break;
        }
-       resizemaps(maxino, hdr.maxino);
-       maxino = hdr.maxino;
+       if (hdr.maxino > maxino) {
+               resizemaps(maxino, hdr.maxino);
+               maxino = hdr.maxino;
+       }
        entrytblsize = hdr.entrytblsize;
        entry = (struct entry **)
                (base + tblsize - (entrytblsize * sizeof(struct entry *)));