summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffdir.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-10-07 23:37:27 +0000
committermillert <millert@openbsd.org>2003-10-07 23:37:27 +0000
commit4893e147a96c816b4d8cd3a964f938216bfca7ef (patch)
treeef13d78587ce38c200c695a40c57a449a3108422 /usr.bin/diff/diffdir.c
parentadd a few regression tests for the recently fixed md functions (diff)
downloadwireguard-openbsd-4893e147a96c816b4d8cd3a964f938216bfca7ef.tar.xz
wireguard-openbsd-4893e147a96c816b4d8cd3a964f938216bfca7ef.zip
Fix printing of "Only in foo" when foo is "/" (trailing slash removal
was overzealous in this case). Fix tested by Hugo Villeneuve and myself.
Diffstat (limited to 'usr.bin/diff/diffdir.c')
-rw-r--r--usr.bin/diff/diffdir.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c
index a7e3df88121..dcdcf41a542 100644
--- a/usr.bin/diff/diffdir.c
+++ b/usr.bin/diff/diffdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diffdir.c,v 1.24 2003/07/21 23:28:00 millert Exp $ */
+/* $OpenBSD: diffdir.c,v 1.25 2003/10/07 23:37:27 millert Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -21,7 +21,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: diffdir.c,v 1.24 2003/07/21 23:28:00 millert Exp $";
+static const char rcsid[] = "$OpenBSD: diffdir.c,v 1.25 2003/10/07 23:37:27 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -118,8 +118,7 @@ diffdir(char *p1, char *p2)
else if (lflag)
dent1->d_status |= D_ONLY;
else
- printf("Only in %.*s: %s\n", (int)(dirlen1 - 1),
- path1, dent1->d_name);
+ print_only(path1, dirlen1, dent1->d_name);
dp1++;
} else {
/* file only in second dir, only diff if -N or -P */
@@ -128,8 +127,7 @@ diffdir(char *p1, char *p2)
else if (lflag)
dent2->d_status |= D_ONLY;
else
- printf("Only in %.*s: %s\n", (int)(dirlen2 - 1),
- path2, dent2->d_name);
+ print_only(path2, dirlen2, dent2->d_name);
dp2++;
}
}