[hackers] [sbase] ed: Move modflag=0 to clearundo() || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Fri, 1 Jan 2016 11:40:05 +0100 (CET)

commit 58c9739532b83220ccf8ac8e6835cf1c6769a282
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jan 1 11:17:00 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Fri Jan 1 10:39:59 2016 +0000

    ed: Move modflag=0 to clearundo()
    
    When we discard the content of an undo buffer
    is because we don't need it anymore, and it means
    that we don't care about the modify state of the buffer
    so we can reset the modflag in clearundo(), and
    remove this assignation each time clearundo() is called.

diff --git a/ed.c b/ed.c
index 623c6b4..751e973 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -247,6 +247,7 @@ clearundo(void)
         free(udata.vec);
         udata.vec = NULL;
         newcmd = udata.nr = udata.cap = 0;
+ modflag = 0;
 }
 
 static void
_AT_@ -342,7 +343,6 @@ setscratch()
                 error("input/output error in scratch file");
         relink(k, k, k, k);
         clearundo();
- modflag = 0;
 }
 
 static void
_AT_@ -1211,7 +1211,6 @@ repeat:
                 deflines(curln, curln);
                 doread(savfname);
                 clearundo();
- modflag = 0;
                 break;
         default:
                 error("unknown command");
Received on Fri Jan 01 2016 - 11:40:05 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 01 2016 - 11:48:15 CET