summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2010-07-16 23:27:59 +0000
committerRay Lai <ray@cvs.openbsd.org>2010-07-16 23:27:59 +0000
commitb3992efcc83913b329c6906e8923a525d3dbed1a (patch)
tree27bab2d1acb4bc50fea9f1857e72137b1bb96df6 /usr.bin
parentcf674661e0c3ed7a3acf4cbe01c553551ba3820f (diff)
Simplify print_status by removing NULL handling.
OK nicm
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/diff/diff.c22
-rw-r--r--usr.bin/diff/diffdir.c4
2 files changed, 12 insertions, 14 deletions
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index 134f2e81ec0..e0c6dbe8c73 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.56 2010/02/21 15:24:01 sobrado Exp $ */
+/* $OpenBSD: diff.c,v 1.57 2010/07/16 23:27:58 ray Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -265,7 +265,7 @@ main(int argc, char **argv)
err(2, "%s", argv[1]);
}
print_status(diffreg(argv[0], argv[1], dflags), argv[0], argv[1],
- NULL);
+ "");
}
exit(status);
}
@@ -360,39 +360,37 @@ print_status(int val, char *path1, char *path2, char *entry)
break;
case D_COMMON:
printf("Common subdirectories: %s%s and %s%s\n",
- path1, entry ? entry : "", path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_BINARY:
printf("Binary files %s%s and %s%s differ\n",
- path1, entry ? entry : "", path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_DIFFER:
if (diff_format == D_BRIEF)
printf("Files %s%s and %s%s differ\n",
- path1, entry ? entry : "",
- path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_SAME:
if (sflag)
printf("Files %s%s and %s%s are identical\n",
- path1, entry ? entry : "",
- path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_MISMATCH1:
printf("File %s%s is a directory while file %s%s is a regular file\n",
- path1, entry ? entry : "", path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_MISMATCH2:
printf("File %s%s is a regular file while file %s%s is a directory\n",
- path1, entry ? entry : "", path2, entry ? entry : "");
+ path1, entry, path2, entry);
break;
case D_SKIPPED1:
printf("File %s%s is not a regular file or directory and was skipped\n",
- path1, entry ? entry : "");
+ path1, entry);
break;
case D_SKIPPED2:
printf("File %s%s is not a regular file or directory and was skipped\n",
- path2, entry ? entry : "");
+ path2, entry);
break;
}
}
diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c
index 42288d7cf3b..073b1fd0206 100644
--- a/usr.bin/diff/diffdir.c
+++ b/usr.bin/diff/diffdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diffdir.c,v 1.35 2009/10/27 23:59:37 deraadt Exp $ */
+/* $OpenBSD: diffdir.c,v 1.36 2010/07/16 23:27:58 ray Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -303,7 +303,7 @@ diffit(struct dirent *dp, char *path1, size_t plen1, char *path2, size_t plen2,
else
dp->d_status = diffreg(path1, path2, flags);
if (!lflag)
- print_status(dp->d_status, path1, path2, NULL);
+ print_status(dp->d_status, path1, path2, "");
}
/*