nano

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

commit a0918c5e985192051575c58715721684e35ae547
parent 879885a73622ae712b7ce0eb88c2bf9647f45d39
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri,  9 May 2025 11:19:28 +0200

tweaks: random unimportant edits here and there

Diffstat:
MChangeLog.1999-2006 | 10+++++-----
Msrc/files.c | 8++++----
Msrc/history.c | 3+--
Msyntax/autoconf.nanorc | 2+-
Msyntax/nftables.nanorc | 2+-
5 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/ChangeLog.1999-2006 b/ChangeLog.1999-2006 @@ -8246,7 +8246,7 @@ nano-0.7.7 - 2000.01.19 - Added check for keystroke key sequence 407 or NANO_CONTROL_Z in main while loop because suspend mode was broken. This should fix it, at least for now. - - Added long option support (By popular harassment ;-) - Added + - Added long option support (by popular harassment ;-) : added #include for getopt.h, changed getopt() to getopt_long(). Options added so far: --version (-V), --nowrap (-w), --suspend (-z), --help (-h), --nohelp (-x). @@ -8258,15 +8258,15 @@ nano 0.7.6 - 2000.01.15 main(): Bound CONTROL_H to backspace (oops). Added more Alt-[-key combinations, for page up & down. read_bytes(): New function. (Adam Rogoyski) - read_file(): Optimizations - malloc()s *buf a little at a time rather - than one huge buffer, and replaced the strcat at the end - with an index variable. Added call to read_bytes(). + read_file(): Optimizations -- malloc()s *buf a little at a time + rather than one huge buffer, and replaced the strcat() at + the end with an index variable. Added call to read_bytes(). do_next_word(): New function, binding is Ctrl-Space (0). (Chris) - winio.c: bottombars(): Fixed non-expanding shortcut keys at bottom of screen. (formula is extra space needed = COLS / 6 - 13). actual_x() & strlenpt(): - Added bug#9 fix - when tabs % 8 == 0, we should only + Added fix for bug #9 -- when tabs % 8 == 0, we should only increment tabs by 1. titlebar(): Fixed overrun in titlebar on very long filenames. diff --git a/src/files.c b/src/files.c @@ -1555,10 +1555,10 @@ void init_backup_dir(void) } #endif -/* Read all data from inn, and write it to out. File inn must be open for - * reading, and out for writing. Return 0 on success, a negative number on - * read error, and a positive number on write error. File inn is always - * closed by this function, out is closed only if close_out is true. */ +/* Read all data from `inn`, and write it to `out`. File `inn` must be open + * for reading, and `out` for writing. Return 0 on success, a negative number + * on read error, and a positive number on write error. File `inn` is always + * closed by this function, `out` is closed only if `close_out` is true. */ int copy_file(FILE *inn, FILE *out, bool close_out) { int retval = 0; diff --git a/src/history.c b/src/history.c @@ -352,11 +352,10 @@ void save_history(void) /* Return as a string... the line numbers of the lines with an anchor. */ char *stringify_anchors(void) { - linestruct *line = openfile->filetop; char *string = copy_of(""); char number[24]; - for (; line != NULL; line = line->next) + for (linestruct *line = openfile->filetop; line != NULL; line = line->next) if (line->has_anchor) { sprintf(number, "%li ", line->lineno); string = nrealloc(string, strlen(string) + strlen(number) + 1); diff --git a/syntax/autoconf.nanorc b/syntax/autoconf.nanorc @@ -29,7 +29,7 @@ color brightred "^[[:blank:]]*\*\*\*.*" color magenta "\[|\]|\(|\)" # Comments: -color blue "^[[:blank:]]*#.*" "\<dnl.*" +color blue "^[[:blank:]]*#.*|\<dnl.*" # Trailing whitespace: color ,green "[[:space:]]+$" diff --git a/syntax/nftables.nanorc b/syntax/nftables.nanorc @@ -1,6 +1,6 @@ ## Syntax highlighting for the packet-filtering rules of Netfilter. -## Original author: Arturo Borrero González <arturo@debian.org> +## Original author: Arturo Borrero González ## License: GPL version 3 or newer syntax nftables "\.(nft|nftables)$"