diff options
author | 2003-10-07 23:37:27 +0000 | |
---|---|---|
committer | 2003-10-07 23:37:27 +0000 | |
commit | 4893e147a96c816b4d8cd3a964f938216bfca7ef (patch) | |
tree | ef13d78587ce38c200c695a40c57a449a3108422 /usr.bin/diff/diffdir.c | |
parent | add a few regression tests for the recently fixed md functions (diff) | |
download | wireguard-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.c | 10 |
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++; } } |