summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-07-21 22:57:18 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-07-21 22:57:18 +0000
commit3cebdcacd492b5f1f39f1ea1462ff968272f41e1 (patch)
tree18a90731b54e7012fbd0832a7f77e616e60bbea3 /usr.bin
parent4096cc14735f450e0e4d12fb1e14a5c2adcc1b3f (diff)
Fix printing of status when not in -l mode which was broken when the
-l support was added.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/diff/diff.c8
-rw-r--r--usr.bin/diff/diffdir.c10
2 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index 91e81bb4a9a..149259e178a 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.30 2003/07/21 21:59:58 henning Exp $ */
+/* $OpenBSD: diff.c,v 1.31 2003/07/21 22:57:16 millert Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -21,7 +21,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: diff.c,v 1.30 2003/07/21 21:59:58 henning Exp $";
+static const char rcsid[] = "$OpenBSD: diff.c,v 1.31 2003/07/21 22:57:16 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -335,11 +335,11 @@ print_status(int val, char *path1, char *path2, char *entry)
path2, entry ? entry : "");
break;
case D_MISMATCH1:
- printf("File %s/%s is a directory while file %s/%s is a file\n",
+ printf("File %s%s is a directory while file %s%s is a regular file\n",
path1, entry ? entry : "", path2, entry ? entry : "");
break;
case D_MISMATCH2:
- printf("File %s/%s is a file while file %s/%s is a directory\n",
+ printf("File %s%s is a regular file while file %s%s is a directory\n",
path1, entry ? entry : "", path2, entry ? entry : "");
break;
}
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);
}
/*