summaryrefslogtreecommitdiffstats
path: root/usr.bin/diff/diffreg.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-07-22 00:20:40 +0000
committermillert <millert@openbsd.org>2003-07-22 00:20:40 +0000
commit52e5bd6b2a3d4d3aa0fc9fae85991484eb9a66f0 (patch)
treef391559a5db2890bc5c2f1b2f3206e0e02259b7d /usr.bin/diff/diffreg.c
parentDon't print lines consisting solely of a dot ('.') in -e mode since (diff)
downloadwireguard-openbsd-52e5bd6b2a3d4d3aa0fc9fae85991484eb9a66f0.tar.xz
wireguard-openbsd-52e5bd6b2a3d4d3aa0fc9fae85991484eb9a66f0.zip
Historically, when comparing two directories in -e mode, BSD diff
printed a header that turned the output into an actual script that called ed(1) to make the changes. This conflicts with POSIX so the header has been removed and the standard diff header is used instead.
Diffstat (limited to 'usr.bin/diff/diffreg.c')
-rw-r--r--usr.bin/diff/diffreg.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index aa07122fc86..7f2eda06521 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diffreg.c,v 1.39 2003/07/22 00:15:55 millert Exp $ */
+/* $OpenBSD: diffreg.c,v 1.40 2003/07/22 00:20:40 millert Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -65,7 +65,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.39 2003/07/22 00:15:55 millert Exp $";
+static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.40 2003/07/22 00:20:40 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -76,7 +76,6 @@ static const char rcsid[] = "$OpenBSD: diffreg.c,v 1.39 2003/07/22 00:15:55 mill
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-#include <libgen.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -397,15 +396,8 @@ notsame:
rewind(stdout);
free(header);
}
- } else {
- if (flags & D_HEADER) {
- if (format == D_EDIT)
- printf("ed - %s << '-*-END-*-'\n",
- basename(file1));
- else
- printf("%s %s %s\n", diffargs, file1, file2);
- }
- }
+ } else if (flags & D_HEADER)
+ printf("%s %s %s\n", diffargs, file1, file2);
prepare(0, f1);
prepare(1, f2);
prune();
@@ -447,8 +439,7 @@ notsame:
close(ostdout);
}
waitpid(pid, &wstatus, 0);
- } else if ((flags & D_HEADER) && format == D_EDIT)
- printf("w\nq\n-*-END-*-\n");
+ }
closem:
if (f1 != NULL)
fclose(f1);