nano

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

commit 3468784b85048e673bbca56a5868987e101591e5
parent 7622ca045658332764c125c5cef84982cc2c5c8c
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date:   Sat, 21 Apr 2007 20:13:06 +0000

further simplify do_writeout()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4093 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

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

diff --git a/src/files.c b/src/files.c @@ -1908,12 +1908,11 @@ bool do_writeout(bool exiting) full_filename = get_full_path(openfile->filename); name_exists = (stat((full_answer == NULL) ? answer : full_answer, &st) != -1); - if (openfile->filename[0] == '\0') - do_warning = name_exists; - else - do_warning = (strcmp((full_answer == NULL) ? - answer : full_answer, (full_filename == NULL) ? - openfile->filename : full_filename) != 0); + do_warning = (name_exists || + (openfile->filename[0] != '\0' && + strcmp((full_answer == NULL) ? answer : + full_answer, (full_filename == NULL) ? + openfile->filename : full_filename) != 0)); /* Convert nulls to newlines. answer_len is the * string's real length. */