From: martijn Date: Mon, 26 Feb 2018 17:35:08 +0000 (+0000) Subject: Make ed(1) warn about modifications if 'r'ead in an empty file and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6aeae0a8cf68bcd82bc9436f7e8f3df63d63a669;p=openbsd Make ed(1) warn about modifications if 'r'ead in an empty file and trying to quit. Diff from Tim Chase OK tb@ and millert@ --- diff --git a/bin/ed/main.c b/bin/ed/main.c index 3ddf399eee6..45688d316ab 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.60 2017/04/26 21:25:43 naddy Exp $ */ +/* $OpenBSD: main.c,v 1.61 2018/02/26 17:35:08 martijn Exp $ */ /* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */ /* main.c: This file contains the main control and user-interface routines @@ -723,7 +723,7 @@ exec_command(void) if ((addr = read_file(*fnp ? fnp : old_filename, second_addr)) < 0) return ERR; - else if (addr && addr != addr_last) + else if (addr) modified = 1; break; case 's':