summaryrefslogtreecommitdiff
path: root/usr.bin/mg
diff options
context:
space:
mode:
authorKjell Wooding <kjell@cvs.openbsd.org>2005-11-20 04:16:35 +0000
committerKjell Wooding <kjell@cvs.openbsd.org>2005-11-20 04:16:35 +0000
commit96ee53a881a4559793a2a7933605b10b285c6443 (patch)
treeac347212cf904ac6148632adea2a618b77812b7e /usr.bin/mg
parentff91a16be9fe95ebe3e02014ff227721ce734f55 (diff)
Kill the NO_BACKUP #ifdef
Diffstat (limited to 'usr.bin/mg')
-rw-r--r--usr.bin/mg/Makefile3
-rw-r--r--usr.bin/mg/file.c32
-rw-r--r--usr.bin/mg/fileio.c4
-rw-r--r--usr.bin/mg/funmap.c4
4 files changed, 10 insertions, 33 deletions
diff --git a/usr.bin/mg/Makefile b/usr.bin/mg/Makefile
index 75e16a0c95a..6ae2c19375c 100644
--- a/usr.bin/mg/Makefile
+++ b/usr.bin/mg/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.16 2005/11/19 22:05:45 kjell Exp $
+# $OpenBSD: Makefile,v 1.17 2005/11/20 04:16:34 kjell Exp $
PROG= mg
@@ -11,7 +11,6 @@ DPADD+= ${LIBCURSES}
# FKEYS -- add support for function key sequences.
# XKEYS -- use termcap function key definitions. Warning -
# XKEYS and bsmap mode do _not_ get along.
-# NO_BACKUP -- disable "make-backup-files"
# PREFIXREGION -- enable function "prefix-region"
# REGEX -- create regular expression functions
#
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index 220e92bffac..d47f28b8a5f 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.46 2005/11/20 03:24:17 deraadt Exp $ */
+/* $OpenBSD: file.c,v 1.47 2005/11/20 04:16:34 kjell Exp $ */
/* This file is in the public domain. */
@@ -273,13 +273,13 @@ readin(char *fname)
* Insert a file in the current buffer, after dot. If file is a directory,
* and 'replacebuf' is TRUE, invoke dired mode, else die with an error.
* If file is a regular file, set mark at the end of the text inserted;
- * point at the beginning. Return a standard status.
- * Print a summary (lines read, error message) out as well. Unless the
- * NO_BACKUP conditional is set, this routine also does the read end of
- * backup processing. The BFBAK flag, if set in a buffer, says that a
- * backup should be taken. It is set when a file is read in, but not on
- * a new file. (You don't need to make a backup copy of nothing.)
+ * point at the beginning. Return a standard status. Print a summary
+ * (lines read, error message) out as well. This routine also does the
+ * read end of backup processing. The BFBAK flag, if set in a buffer,
+ * says that a backup should be taken. It is set when a file is read in,
+ * but not on a new file. You don't need to make a backup copy of nothing.
*/
+
static char *line = NULL;
static int linesize = 0;
@@ -422,14 +422,10 @@ endoffile:
curwp->w_doto = opos;
if (olp == curbp->b_linep)
curwp->w_dotp = lforw(olp);
-#ifndef NO_BACKUP
if (newname != NULL)
bp->b_flag |= BFCHG | BFBAK; /* Need a backup. */
else
bp->b_flag |= BFCHG;
-#else /* !NO_BACKUP */
- bp->b_flag |= BFCHG;
-#endif /* !NO_BACKUP */
/*
* If the insert was at the end of buffer, set lp1 to the end of
* buffer line, and lp2 to the beginning of the newly inserted text.
@@ -500,11 +496,7 @@ filewrite(int f, int n)
if (curbp->b_bname)
free((char *)curbp->b_bname);
curbp->b_bname = strdup(p);
-#ifndef NO_BACKUP
curbp->b_flag &= ~(BFBAK | BFCHG);
-#else /* !NO_BACKUP */
- curbp->b_flag &= ~BFCHG;
-#endif /* !NO_BACKUP */
upmodes(curbp);
}
return (s);
@@ -513,12 +505,10 @@ filewrite(int f, int n)
/*
* Save the contents of the current buffer back into its associated file.
*/
-#ifndef NO_BACKUP
#ifndef MAKEBACKUP
#define MAKEBACKUP TRUE
#endif /* !MAKEBACKUP */
static int makebackup = MAKEBACKUP;
-#endif /* !NO_BACKUP */
/* ARGSUSED */
int
@@ -552,7 +542,6 @@ buffsave(struct buffer *bp)
return (FALSE);
}
-#ifndef NO_BACKUP
if (makebackup && (bp->b_flag & BFBAK)) {
s = fbackupfile(bp->b_fname);
/* hard error */
@@ -563,19 +552,13 @@ buffsave(struct buffer *bp)
(s = eyesno("Backup error, save anyway")) != TRUE)
return (s);
}
-#endif /* !NO_BACKUP */
if ((s = writeout(bp, bp->b_fname)) == TRUE) {
-#ifndef NO_BACKUP
bp->b_flag &= ~(BFCHG | BFBAK);
-#else /* !NO_BACKUP */
- bp->b_flag &= ~BFCHG;
-#endif /* !NO_BACKUP */
upmodes(bp);
}
return (s);
}
-#ifndef NO_BACKUP
/*
* Since we don't have variables (we probably should) this is a command
* processor for changing the value of the make backup flag. If no argument
@@ -594,7 +577,6 @@ makebkfile(int f, int n)
ewprintf("Backup files %sabled", makebackup ? "en" : "dis");
return (TRUE);
}
-#endif /* !NO_BACKUP */
/*
* NB: bp is passed to both ffwopen and ffclose because some
diff --git a/usr.bin/mg/fileio.c b/usr.bin/mg/fileio.c
index ead3aa3ed00..deb2a2a9838 100644
--- a/usr.bin/mg/fileio.c
+++ b/usr.bin/mg/fileio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fileio.c,v 1.63 2005/11/20 03:24:17 deraadt Exp $ */
+/* $OpenBSD: fileio.c,v 1.64 2005/11/20 04:16:34 kjell Exp $ */
/* This file is in the public domain. */
@@ -156,7 +156,6 @@ ffgetline(char *buf, int nbuf, int *nbytes)
return (c == EOF ? FIOEOF : FIOSUC);
}
-#ifndef NO_BACKUP
/*
* Make a backup copy of "fname". On Unix the backup has the same
* name as the original file, with a "~" on the end; this seems to
@@ -230,7 +229,6 @@ fbackupfile(const char *fn)
return (nread == -1 ? FALSE : TRUE);
}
-#endif
/*
* The string "fn" is a file name.
diff --git a/usr.bin/mg/funmap.c b/usr.bin/mg/funmap.c
index 34e473e222e..0d717cef54c 100644
--- a/usr.bin/mg/funmap.c
+++ b/usr.bin/mg/funmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: funmap.c,v 1.18 2005/11/19 20:14:38 kjell Exp $ */
+/* $OpenBSD: funmap.c,v 1.19 2005/11/20 04:16:34 kjell Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -137,9 +137,7 @@ static struct funmap functnames[] = {
#endif /* !NO_STARTUP */
{localbind, "local-set-key",},
{localunbind, "local-unset-key",},
-#ifndef NO_BACKUP
{makebkfile, "make-backup-files",},
-#endif /* !NO_BACKUP */
{do_meta, "meta-key-mode",}, /* better name, anyone? */
{negative_argument, "negative-argument",},
{newline, "newline",},