From cdc56b0e2ba4dd04377b120b19b0a3f13d1a3e29 Mon Sep 17 00:00:00 2001 From: natano Date: Tue, 16 Aug 2016 20:04:46 +0000 Subject: [PATCH] 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 --- bin/ed/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1