can only define inumber if file exists on tape (from shannon@sun.com)
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 24 Apr 1987 13:43:53 +0000 (05:43 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 24 Apr 1987 13:43:53 +0000 (05:43 -0800)
SCCS-vsn: sbin/restore/interactive.c 5.5

usr/src/sbin/restore/interactive.c

index 3804e57..112f5db 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)interactive.c      5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)interactive.c      5.5 (Berkeley) %G%";
 #endif not lint
 
 #include "restore.h"
 #endif not lint
 
 #include "restore.h"
@@ -433,12 +433,14 @@ expandarg(arg, ap)
        register struct arglist *ap;
 {
        static struct afile single;
        register struct arglist *ap;
 {
        static struct afile single;
+       struct entry *ep;
        int size;
 
        ap->head = ap->last = (struct afile *)0;
        size = expand(arg, 0, ap);
        if (size == 0) {
        int size;
 
        ap->head = ap->last = (struct afile *)0;
        size = expand(arg, 0, ap);
        if (size == 0) {
-               single.fnum = lookupname(arg)->e_ino;
+               ep = lookupname(arg);
+               single.fnum = ep ? ep->e_ino : 0;
                single.fname = savename(arg);
                ap->head = &single;
                ap->last = ap->head + 1;
                single.fname = savename(arg);
                ap->head = &single;
                ap->last = ap->head + 1;