From 37e8779f86d73af68c0ee95dca64b18732a5f34a Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 21 Jul 2003 23:02:35 +0000 Subject: Don't print a trailing '/' in foo when printing "Only in foo: bar" --- usr.bin/diff/diff.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr.bin/diff/diff.c') diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 149259e178a..e0be80890f1 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.31 2003/07/21 22:57:16 millert Exp $ */ +/* $OpenBSD: diff.c,v 1.32 2003/07/21 23:02:35 millert Exp $ */ /* * Copyright (c) 2003 Todd C. Miller @@ -21,7 +21,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: diff.c,v 1.31 2003/07/21 22:57:16 millert Exp $"; +static const char rcsid[] = "$OpenBSD: diff.c,v 1.32 2003/07/21 23:02:35 millert Exp $"; #endif /* not lint */ #include @@ -312,7 +312,9 @@ print_status(int val, char *path1, char *path2, char *entry) { switch (val) { case D_ONLY: - printf("Only in %s: %s\n", path1, entry); + /* must strip off the trailing '/' */ + printf("Only in %.*s: %s\n", (int)(strlen(path1) - 1), + path1, entry); break; case D_COMMON: printf("Common subdirectories: %s%s and %s%s\n", -- cgit v1.2.3-59-g8ed1b