nano

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

commit d26916199bdc3513138e2b7d82a8b325abcd859c
parent 2e9fb7d8401f7d41c37bce1f33f5a3ecea92077d
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  3 Oct 2020 11:58:43 +0200

tweaks: reshuffle some lines after the previous change

Diffstat:
Msrc/nano.c | 6+++---
Msrc/rcfile.c | 28++++++++++++----------------
2 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/src/nano.c b/src/nano.c @@ -2127,9 +2127,9 @@ int main(int argc, char **argv) ssize_t fill_cmdline = fill; #endif #ifndef NANO_TINY - size_t stripeclm_cmdline = stripe_column; char *backup_dir_cmdline = backup_dir; char *word_chars_cmdline = word_chars; + size_t stripeclm_cmdline = stripe_column; ssize_t tabsize_cmdline = tabsize; #endif #ifdef ENABLE_OPERATINGDIR @@ -2169,8 +2169,6 @@ int main(int argc, char **argv) fill = fill_cmdline; #endif #ifndef NANO_TINY - if (stripeclm_cmdline > 0) - stripe_column = stripeclm_cmdline; if (backup_dir_cmdline != NULL) { free(backup_dir); backup_dir = backup_dir_cmdline; @@ -2179,6 +2177,8 @@ int main(int argc, char **argv) free(word_chars); word_chars = word_chars_cmdline; } + if (stripeclm_cmdline > 0) + stripe_column = stripeclm_cmdline; if (tabsize_cmdline != -1) tabsize = tabsize_cmdline; #endif diff --git a/src/rcfile.c b/src/rcfile.c @@ -1585,13 +1585,7 @@ void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only) } else #endif #ifndef NANO_TINY - if (strcmp(option, "guidestripe") == 0) { - if (!parse_num(argument, &stripe_column) || stripe_column <= 0) { - jot_error(N_("Guide column \"%s\" is invalid"), argument); - stripe_column = 0; - } - free(argument); - } else if (strcmp(option, "matchbrackets") == 0) { + if (strcmp(option, "matchbrackets") == 0) { if (has_blank_char(argument)) { jot_error(N_("Non-blank characters required")); free(argument); @@ -1628,21 +1622,23 @@ void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only) quotestr = argument; else #endif -#ifndef NANO_TINY - if (strcmp(option, "backupdir") == 0) - backup_dir = argument; - else - if (strcmp(option, "wordchars") == 0) - word_chars = argument; - else -#endif #ifdef ENABLE_SPELLER if (strcmp(option, "speller") == 0) alt_speller = argument; else #endif #ifndef NANO_TINY - if (strcmp(option, "tabsize") == 0) { + if (strcmp(option, "backupdir") == 0) + backup_dir = argument; + else if (strcmp(option, "wordchars") == 0) + word_chars = argument; + else if (strcmp(option, "guidestripe") == 0) { + if (!parse_num(argument, &stripe_column) || stripe_column <= 0) { + jot_error(N_("Guide column \"%s\" is invalid"), argument); + stripe_column = 0; + } + free(argument); + } else if (strcmp(option, "tabsize") == 0) { if (!parse_num(argument, &tabsize) || tabsize <= 0) { jot_error(N_("Requested tab size \"%s\" is invalid"), argument); tabsize = -1;