summaryrefslogtreecommitdiff
path: root/usr.bin/mg/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mg/file.c')
-rw-r--r--usr.bin/mg/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mg/file.c b/usr.bin/mg/file.c
index fffdfa43e34..e736c73b03d 100644
--- a/usr.bin/mg/file.c
+++ b/usr.bin/mg/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.78 2012/05/08 15:26:31 lum Exp $ */
+/* $OpenBSD: file.c,v 1.79 2012/05/10 16:07:46 lum Exp $ */
/* This file is in the public domain. */
@@ -549,7 +549,10 @@ static int makebackup = MAKEBACKUP;
int
filesave(int f, int n)
{
- return (buffsave(curbp));
+ if (curbp->b_fname[0] == '\0')
+ return (filewrite(f, n));
+ else
+ return (buffsave(curbp));
}
/*