]> git.wh0rd.org - dump.git/blobdiff - dump/optr.c
Fixed an off-by-one calculation when dumping a one letter subdirectory.
[dump.git] / dump / optr.c
index 88ff63d0c8e708fd55aabdaace79e76add26b259..6b86b9a8da2e0f9ce6cc8897b99140c8b31c9308 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: optr.c,v 1.24 2001/06/18 11:07:45 stelian Exp $";
+       "$Id: optr.c,v 1.28 2001/12/24 12:28:39 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
 #include <sys/param.h>
 #include <sys/wait.h>
 #include <sys/time.h>
+#include <time.h>
 
 #include <errno.h>
 #include <fstab.h>
@@ -69,7 +70,6 @@ static const char rcsid[] =
 #include <ext2fs/ext2fs.h>
 #include <bsdcompat.h>
 #include <signal.h>
-#include <time.h>
 #endif
 
 #include "dump.h"
@@ -105,6 +105,12 @@ query(const char *question)
        FILE    *mytty;
        time_t  firstprompt, when_answered;
 
+       if (qflag) {
+               msg("%s - forced abort\n", question);
+               dumpabort(0);
+               /* NOTREACHED */
+       }
+
        firstprompt = time(NULL);
 
        if ((mytty = fopen(_PATH_TTY, "r")) == NULL)
@@ -533,7 +539,7 @@ fstabsearchdir(const char *key, char *directory)
        for (pf = table; pf != NULL; pf = pf->pf_next) {
                fs = pf->pf_fstab;
                if (strlen(fs->fs_file) > size &&
-                   strlen(key) > strlen(fs->fs_file) + 1 &&
+                   strlen(key) > strlen(fs->fs_file) &&
                    strncmp(fs->fs_file, key, strlen(fs->fs_file)) == 0 &&
                    (key[strlen(fs->fs_file)] == '/' ||
                     fs->fs_file[strlen(fs->fs_file) - 1] == '/')) {