X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Foptr.c;h=a79462b24764c4f3aa42204e27ac5f5e36305949;hb=a6cef1aead17d4abfe39ee0fdbda7c774c6444f6;hp=88ff63d0c8e708fd55aabdaace79e76add26b259;hpb=8bfad78a38f63cccdfba87667adf9b6151524088;p=dump.git diff --git a/dump/optr.c b/dump/optr.c index 88ff63d..a79462b 100644 --- a/dump/optr.c +++ b/dump/optr.c @@ -2,8 +2,8 @@ * Ported to Linux's Second Extended File System as part of the * dump and restore backup suit * Remy Card , 1994-1997 - * Stelian Pop , 1999-2000 - * Stelian Pop - Alcôve , 2000 + * Stelian Pop , 1999-2000 + * Stelian Pop - Alcôve , 2000-2002 */ /*- @@ -41,13 +41,14 @@ #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.31 2002/02/04 11:18:45 stelian Exp $"; #endif /* not lint */ #include #include #include #include +#include #include #include @@ -69,7 +70,6 @@ static const char rcsid[] = #include #include #include -#include #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) @@ -279,7 +285,7 @@ static void sendmes(const char *tty, const char *message) { char t[MAXPATHLEN], buf[BUFSIZ]; - register const char *cp; + const char *cp; int lmsg = 1; FILE *f_tty; @@ -420,7 +426,7 @@ quit(fmt, va_alist) static struct fstab * allocfsent(struct fstab *fs) { - register struct fstab *new; + struct fstab *new; new = (struct fstab *)malloc(sizeof (*fs)); if (new == NULL) @@ -463,6 +469,7 @@ getfstab(void) strcmp(fs->fs_type, FSTAB_RQ)) continue; fs = allocfsent(fs); + fs->fs_passno = 0; if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL) quit("%s\n", strerror(errno)); pf->pf_fstab = fs; @@ -493,8 +500,8 @@ getfstab(void) struct fstab * fstabsearch(const char *key) { - register struct pfstab *pf; - register struct fstab *fs; + struct pfstab *pf; + struct fstab *fs; const char *rn; for (pf = table; pf != NULL; pf = pf->pf_next) { @@ -521,9 +528,9 @@ fstabsearch(const char *key) struct fstab * fstabsearchdir(const char *key, char *directory) { - register struct pfstab *pf; - register struct fstab *fs; - register struct fstab *found_fs = NULL; + struct pfstab *pf; + struct fstab *fs; + struct fstab *found_fs = NULL; unsigned int size = 0; struct stat buf; @@ -533,7 +540,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] == '/')) {