sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 18ab2f4c2ec658061f6a603c02b02fb4862770b6
parent 76036b0183dcc53de54625a2e78b0edd72d9ae3a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri Jan  1 11:17:00 +0100

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.

Diffstat:
ed.c | 3+--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ed.c b/ed.c @@ -247,6 +247,7 @@ clearundo(void) free(udata.vec); udata.vec = NULL; newcmd = udata.nr = udata.cap = 0; + modflag = 0; } static void @@ -342,7 +343,6 @@ setscratch() error("input/output error in scratch file"); relink(k, k, k, k); clearundo(); - modflag = 0; } static void @@ -1211,7 +1211,6 @@ repeat: deflines(curln, curln); doread(savfname); clearundo(); - modflag = 0; break; default: error("unknown command");