summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diff.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2004-03-16 00:40:34 +0000
committermillert <millert@openbsd.org>2004-03-16 00:40:34 +0000
commit5f4c3fa8c992a73cf3a590bb05e0fcfe882394cd (patch)
treef531dd735f940af417621b3f0eeb3a7893e008a1 /usr.bin/diff/diff.c
parentAnd two promise pciide, from chris@ (diff)
downloadwireguard-openbsd-5f4c3fa8c992a73cf3a590bb05e0fcfe882394cd.tar.xz
wireguard-openbsd-5f4c3fa8c992a73cf3a590bb05e0fcfe882394cd.zip
POSIX specifies that in directory mode device special files and
FIFOs shall be skipped. Other types of files may be skipped too (this is implementation-dependent). In directory mode, just skip anything that is not a regular file or directory. OK tedu@
Diffstat (limited to 'usr.bin/diff/diff.c')
-rw-r--r--usr.bin/diff/diff.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index 7ad00106cae..134cb37c0f3 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.44 2004/01/07 17:18:32 otto Exp $ */
+/* $OpenBSD: diff.c,v 1.45 2004/03/16 00:40:34 millert Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -21,7 +21,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: diff.c,v 1.44 2004/01/07 17:18:32 otto Exp $";
+static const char rcsid[] = "$OpenBSD: diff.c,v 1.45 2004/03/16 00:40:34 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -385,6 +385,14 @@ print_status(int val, char *path1, char *path2, char *entry)
printf("File %s%s is a regular file while file %s%s is a directory\n",
path1, entry ? entry : "", path2, entry ? entry : "");
break;
+ case D_SKIPPED1:
+ printf("File %s%s is not a regular file or directory and was skipped\n",
+ path1, entry ? entry : "");
+ break;
+ case D_SKIPPED2:
+ printf("File %s%s is not a regular file or directory and was skipped\n",
+ path2, entry ? entry : "");
+ break;
}
}