diff options
author | 2003-07-21 22:57:16 +0000 | |
---|---|---|
committer | 2003-07-21 22:57:16 +0000 | |
commit | de41415836bb14cf4a42db4b24855c7542937ddb (patch) | |
tree | ce9f94e5bf2df5bf82257d50ae81f592fcea92ef /usr.bin/diff/diffdir.c | |
parent | enforce restrictions on prot and flags to mprotect and mmap. invalid or (diff) | |
download | wireguard-openbsd-de41415836bb14cf4a42db4b24855c7542937ddb.tar.xz wireguard-openbsd-de41415836bb14cf4a42db4b24855c7542937ddb.zip |
Fix printing of status when not in -l mode which was broken when the
-l support was added.
Diffstat (limited to 'usr.bin/diff/diffdir.c')
-rw-r--r-- | usr.bin/diff/diffdir.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index 63f555db984..f130cf00568 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diffdir.c,v 1.22 2003/07/09 00:07:44 millert Exp $ */ +/* $OpenBSD: diffdir.c,v 1.23 2003/07/21 22:57:17 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.22 2003/07/09 00:07:44 millert Exp $"; +static const char rcsid[] = "$OpenBSD: diffdir.c,v 1.23 2003/07/21 22:57:17 millert Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -138,8 +138,8 @@ diffdir(char *p1, char *p2) } } if (lflag) { - path1[dirlen1 - 1] = '\0'; - path2[dirlen2 - 1] = '\0'; + path1[dirlen1] = '\0'; + path2[dirlen2] = '\0'; for (dp1 = dirp1; (dent1 = *dp1) != NULL; dp1++) { print_status(dent1->d_status, path1, path2, dent1->d_name); @@ -291,6 +291,8 @@ diffit(struct dirent *dp, char *path1, size_t plen1, char *path2, size_t plen2) return; } dp->d_status = diffreg(path1, path2, flags); + if (!lflag) + print_status(dp->d_status, path1, path2, NULL); } /* |