really only unlink regular files (from I stay up all night reading code, Torek)
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 16 Oct 1985 12:14:51 +0000 (04:14 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Wed, 16 Oct 1985 12:14:51 +0000 (04:14 -0800)
SCCS-vsn: old/catman/catman.c 5.4

usr/src/old/catman/catman.c

index 83aa47e..8bb7060 100644 (file)
@@ -11,7 +11,7 @@ char copyright[] =
 #endif not lint
 
 #ifndef lint
 #endif not lint
 
 #ifndef lint
-static char sccsid[] = "@(#)catman.c   5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)catman.c   5.4 (Berkeley) %G%";
 #endif not lint
 
 /*
 #endif not lint
 
 /*
@@ -184,7 +184,7 @@ usage:
                                 * Don't unlink a directory by accident.
                                 */
                                if (stat(lncat, &sbuf) >= 0 &&
                                 * Don't unlink a directory by accident.
                                 */
                                if (stat(lncat, &sbuf) >= 0 &&
-                                   ((sbuf.st_mode&S_IFMT)==S_IFCHR))
+                                   ((sbuf.st_mode&S_IFMT)==S_IFREG))
                                        unlink(cat);
                                if (pflag)
                                        printf("ln %s %s\n", lncat, cat);
                                        unlink(cat);
                                if (pflag)
                                        printf("ln %s %s\n", lncat, cat);