From: natano Date: Tue, 16 Aug 2016 20:04:46 +0000 (+0000) Subject: Piping to a shell command does not count as a save, so don't reset the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cdc56b0e2ba4dd04377b120b19b0a3f13d1a3e29;p=openbsd Piping to a shell command does not count as a save, so don't reset the modified flag. from Jerome Frgacic (jerome.frgacic (at) yahoo.fr) ok tb --- diff --git a/bin/ed/main.c b/bin/ed/main.c index 1cf2e3249d2..1495c0beef2 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.57 2016/03/22 17:58:28 mmcc Exp $ */ +/* $OpenBSD: main.c,v 1.58 2016/08/16 20:04:46 natano 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 @@ -859,7 +859,7 @@ exec_command(void) if ((addr = write_file(*fnp ? fnp : old_filename, (c == 'W') ? "a" : "w", first_addr, second_addr)) < 0) return ERR; - else if (addr == addr_last) + else if (addr == addr_last && *fnp != '!') modified = 0; else if (modified && !scripted && n == 'q') gflag = EMOD;