nano

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

commit 619044e83d463b8dcb2aed6ac1d8be967dadd93a
parent e0e788e218f9316e33b0b494b6ac7db62f921f6f
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Tue, 24 May 2016 10:03:33 +0200

tweaks: put some conditions in a better order: the main one first

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

diff --git a/src/files.c b/src/files.c @@ -2250,7 +2250,7 @@ int do_writeout(bool exiting) given = mallocstrcpy(NULL, #ifndef NANO_TINY - (!exiting && openfile->mark_set) ? "" : + (openfile->mark_set && !exiting) ? "" : #endif openfile->filename); @@ -2268,7 +2268,7 @@ int do_writeout(bool exiting) * Selection to File" prompt. This function is disabled, since * it allows reading from or writing to files not specified on * the command line. */ - if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set) + if (openfile->mark_set && !exiting && !ISSET(RESTRICTED)) msg = (append == PREPEND) ? _("Prepend Selection to File") : (append == APPEND) ? _("Append Selection to File") : _("Write Selection to File"); @@ -2469,7 +2469,7 @@ int do_writeout(bool exiting) * function is disabled, since it allows reading from or * writing to files not specified on the command line. */ #ifndef NANO_TINY - if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set) + if (openfile->mark_set && !exiting && !ISSET(RESTRICTED)) result = write_marked_file(answer, NULL, FALSE, append); else #endif