summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-12-04 21:23:19 +0000
committermmcc <mmcc@openbsd.org>2015-12-04 21:23:19 +0000
commit1c51b8a569b04b08c21215b273c61fc575922e77 (patch)
tree6bb9a2afa120f5a63857a3103902ad977592fa06
parentEnter a static ARP entry for a fake address which is not published (diff)
downloadwireguard-openbsd-1c51b8a569b04b08c21215b273c61fc575922e77.tar.xz
wireguard-openbsd-1c51b8a569b04b08c21215b273c61fc575922e77.zip
Document that the -M option doesn't save a backup when passed ''. Also
clean up the corresponding logic to avoid a useless rename(2) call. ok deraadt sthen
-rw-r--r--usr.bin/unifdef/unifdef.17
-rw-r--r--usr.bin/unifdef/unifdef.c4
2 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/unifdef/unifdef.1 b/usr.bin/unifdef/unifdef.1
index 9418934a517..8c442a1bcf6 100644
--- a/usr.bin/unifdef/unifdef.1
+++ b/usr.bin/unifdef/unifdef.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: unifdef.1,v 1.24 2015/09/12 15:27:38 schwarze Exp $
+.\" $OpenBSD: unifdef.1,v 1.25 2015/12/04 21:23:19 mmcc Exp $
.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" Copyright (c) 2002 - 2013 Tony Finch <dot@dotat.at>. All rights reserved.
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: September 12 2015 $
+.Dd $Mdocdate: December 4 2015 $
.Dt UNIFDEF 1
.Os
.Sh NAME
@@ -312,6 +312,9 @@ Modify input files in place, and keep backups of the original files by
appending the
.Ar backext
to the input filenames.
+If a zero length
+.Ar extension
+is given, no backup will be saved.
.Pp
.It Fl m
Modify one or more input files in place.
diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c
index 13b871b3917..419624f16b3 100644
--- a/usr.bin/unifdef/unifdef.c
+++ b/usr.bin/unifdef/unifdef.c
@@ -56,7 +56,7 @@
static const char copyright[] =
#include "version.h"
- "@(#) $Author: deraadt $\n"
+ "@(#) $Author: mmcc $\n"
"@(#) $URL: http://dotat.at/prog/unifdef $\n"
;
@@ -425,7 +425,7 @@ processinout(const char *ifn, const char *ofn)
process();
- if (backext != NULL) {
+ if (backext != NULL && *backext != '\0') {
char *backname = astrcat(ofn, backext);
if (rename(ofn, backname) < 0)
err(2, "can't rename \"%s\" to \"%s\"", ofn, backname);