nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e64e54d57fe2e35ce71520917933d6a1fdb28412
parent d4ee6a2b534ff75876232e01aa1c008bfc04260e
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  1 May 2020 11:40:18 +0200

tweaks: condense a bit of code, by reusing an existing variable

Diffstat:
Msrc/files.c | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -1973,12 +1973,9 @@ bool write_file(const char *name, FILE *thefile, bool tmp, /* If the syntax changed, discard and recompute the multidata. */ if (strcmp(oldname, newname) != 0) { - linestruct *lin = openfile->filetop; - - while (lin != NULL) { - free(lin->multidata); - lin->multidata = NULL; - lin = lin->next; + for (line = openfile->filetop; line != NULL; line = line->next) { + free(line->multidata); + line->multidata = NULL; } precalc_multicolorinfo();