From 4893e147a96c816b4d8cd3a964f938216bfca7ef Mon Sep 17 00:00:00 2001 From: millert Date: Tue, 7 Oct 2003 23:37:27 +0000 Subject: Fix printing of "Only in foo" when foo is "/" (trailing slash removal was overzealous in this case). Fix tested by Hugo Villeneuve and myself. --- usr.bin/diff/diffdir.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'usr.bin/diff/diffdir.c') 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 @@ -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 @@ -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++; } } -- cgit v1.2.3-59-g8ed1b