/* Copyright (c) 1983 Regents of the University of California */
#ifndef lint
-static char sccsid[] = "@(#)main.c 3.3 (Berkeley) 83/02/27";
+static char sccsid[] = "@(#)main.c 3.5 (Berkeley) 83/03/05";
#endif
/*
char *inputdev = "/dev/rmt8";
char *symtbl = "./restoresymtable";
char *dirmodefile = "./dirmodes";
+ char name[BUFSIZ];
int (*signal())();
extern int onintr();
yflag++;
break;
case 'f':
+ if (argc < 1) {
+ fprintf(stderr, "missing device specifier\n");
+ done(1);
+ }
inputdev = *argv++;
argc--;
break;
/*
* dumpnum (skip to) for multifile dump tapes
*/
+ if (argc < 1) {
+ fprintf(stderr, "missing dump number\n");
+ done(1);
+ }
dumpnum = atoi(*argv++);
if (dumpnum <= 0) {
fprintf(stderr, "Dump number must be a positive integer\n");
argc--;
break;
case 't':
- if (command != '\0') {
- fprintf(stderr,
- "t and %c are mutually exclusive\n",
- command);
- goto usage;
- }
- command = 't';
- break;
case 'R':
- if (command != '\0') {
- fprintf(stderr,
- "R and %c are mutually exclusive\n",
- command);
- goto usage;
- }
- command = 'R';
- break;
case 'r':
- if (command != '\0') {
- fprintf(stderr,
- "r and %c are mutually exclusive\n",
- command);
- goto usage;
- }
- command = 'r';
- break;
case 'x':
if (command != '\0') {
fprintf(stderr,
- "x and %c are mutually exclusive\n",
- command);
+ "%c and %c are mutually exclusive\n",
+ *cp, command);
goto usage;
}
- command = 'x';
+ command = *cp;
break;
default:
fprintf(stderr, "Bad key character %c\n", *cp);
setup();
extractdirs((char *)0);
while (argc--) {
- if ((ino = psearch(*argv)) == 0 ||
+ canon(*argv++, name);
+ if ((ino = psearch(name)) == 0 ||
BIT(ino, dumpmap) == 0) {
- fprintf(stderr, "%s: not on tape\n", *argv++);
+ fprintf(stderr, "%s: not on tape\n", name);
continue;
}
- treescan(*argv++, ino, listfile);
+ if (hflag)
+ treescan(name, ino, listfile);
+ else
+ listfile(name, ino, inodetype(ino));
}
done(0);
panic("no memory for entry table\n");
(void)addentry(".", ROOTINO, NODE);
while (argc--) {
- if ((ino = psearch(*argv)) == 0 ||
+ canon(*argv++, name);
+ if ((ino = psearch(name)) == 0 ||
BIT(ino, dumpmap) == 0) {
- fprintf(stderr, "%s: not on tape\n", *argv++);
+ fprintf(stderr, "%s: not on tape\n", name);
continue;
}
if (mflag)
- pathcheck(*argv, NEW);
+ pathcheck(name, NULL);
if (hflag)
- treescan(*argv++, ino, addfile);
+ treescan(name, ino, addfile);
else
- addfile(*argv++, ino, LEAF);
+ addfile(name, ino, inodetype(ino));
}
- createnodes();
createfiles();
createlinks();
setdirmodes(dirmodefile);
case 'R':
initsymtable(symtbl);
+ skipmaps();
+ skipdirs();
createleaves(symtbl);
createlinks();
setdirmodes(dirmodefile);