X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Fmain.c;h=f5fd9893b875bb818bf95d95ac4dd2a9e06379ec;hb=a2c9bd286cf061b9c6e6565474c1af77e8cf2d1e;hp=cc1ed919ab0109739920748656d33f87520f9683;hpb=7c6b27d3f3dcb57fd3d318dd6e4af05f222d15c5;p=dump.git diff --git a/dump/main.c b/dump/main.c index cc1ed91..f5fd989 100644 --- a/dump/main.c +++ b/dump/main.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: main.c,v 1.13 2000/01/25 14:14:12 stelian Exp $"; + "$Id: main.c,v 1.14 2000/01/26 11:38:08 stelian Exp $"; #endif /* not lint */ #include @@ -344,6 +344,12 @@ main(int argc, char *argv[]) signal(SIGINT, SIG_IGN); set_operators(); /* /etc/group snarfed */ getfstab(); /* /etc/fstab snarfed */ + /* + * disk may end in / and this can confuse + * fstabsearch. + */ + if (strlen(disk) > 1 && disk[strlen(disk) - 1] == '/') + disk[strlen(disk) - 1] = '\0'; /* * disk can be either the full special file name, * the suffix of the special file name, @@ -367,10 +373,10 @@ main(int argc, char *argv[]) dt = fstabsearchdir(pathname, directory); if (dt != NULL) { char name[MAXPATHLEN]; + (void)strncpy(spcl.c_dev, dt->fs_spec, NAMELEN); (void)sprintf(name, "%s (dir %s)", - dt->fs_spec, directory); - (void)strncpy(spcl.c_dev, name, NAMELEN); - (void)strncpy(spcl.c_filesys, dt->fs_file, NAMELEN); + dt->fs_file, directory); + (void)strncpy(spcl.c_filesys, name, NAMELEN); disk = rawname(dt->fs_spec); } else { (void)strncpy(spcl.c_dev, disk, NAMELEN); @@ -421,9 +427,7 @@ main(int argc, char *argv[]) #else spcl.c_ddate == 0 ? "the epoch\n" : ctime(&spcl.c_ddate)); #endif - msg("Dumping %s ", disk); - if (dt != NULL) - msgtail("(%s) ", dt->fs_file); + msg("Dumping %s (%s) ", disk, spcl.c_filesys); if (host) msgtail("to %s on host %s\n", tape, host); else