From 5f4c3fa8c992a73cf3a590bb05e0fcfe882394cd Mon Sep 17 00:00:00 2001 From: millert Date: Tue, 16 Mar 2004 00:40:34 +0000 Subject: 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@ --- usr.bin/diff/diff.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'usr.bin/diff/diff.c') 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 @@ -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 @@ -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; } } -- cgit v1.2.3-59-g8ed1b