nano

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

commit 3e9ef3032f0151ced1531387897ea6e8cbf1598b
parent 6fb15098179ecd3638b2ed7c31339c8018b62cd0
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu, 24 May 2018 18:28:59 +0200

tweaks: use a more meaningful variable name, and avoid a distant 'else'

Also, indent a continuation line better.

Diffstat:
Msrc/text.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -3264,15 +3264,16 @@ void do_linter(void) struct stat lintfileinfo; if (stat(curlint->filename, &lintfileinfo) != -1 && - openfile->current_stat->st_ino != lintfileinfo.st_ino) { + openfile->current_stat->st_ino != lintfileinfo.st_ino) { #ifdef ENABLE_MULTIBUFFER - openfilestruct *tmpof = openfile->next; + const openfilestruct *started_at = openfile; - while (tmpof != openfile && - tmpof->current_stat->st_ino != lintfileinfo.st_ino) - tmpof = tmpof->next; + openfile = openfile->next; + while (openfile != started_at && + openfile->current_stat->st_ino != lintfileinfo.st_ino) + openfile = openfile->next; - if (tmpof->current_stat->st_ino != lintfileinfo.st_ino) { + if (openfile->current_stat->st_ino != lintfileinfo.st_ino) { char *msg = charalloc(1024 + strlen(curlint->filename)); int i; @@ -3323,8 +3324,7 @@ void do_linter(void) free(dontwantfile); #ifdef ENABLE_MULTIBUFFER } - } else - openfile = tmpof; + } #endif }