From fde86518ae76d8a82ccc2cb629fb6702b2fa3134 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 29 Sep 2021 15:23:49 +0200 Subject: [PATCH] tweaks: rename a function, to be more fitting The file wasn't marked; a piece of text was marked, resulting in a region, and it is this region that gets written out to a file. --- src/files.c | 4 ++-- src/prototypes.h | 8 ++++---- src/text.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/files.c b/src/files.c index c4cdfd93..484852a9 100644 --- a/src/files.c +++ b/src/files.c @@ -2047,7 +2047,7 @@ bool write_file(const char *name, FILE *thefile, bool normal, #ifndef NANO_TINY /* Write the marked region of the current buffer out to disk. * Return TRUE on success and FALSE on error. */ -bool write_marked_file(const char *name, FILE *stream, bool normal, +bool write_region_to_file(const char *name, FILE *stream, bool normal, kind_of_writing_type method) { linestruct *birthline, *topline, *botline, *stopper, *afterline; @@ -2324,7 +2324,7 @@ int do_writeout(bool exiting, bool withprompt) * the marked region; otherwise, write out the whole buffer. */ #ifndef NANO_TINY if (openfile->mark && withprompt && !exiting && !ISSET(RESTRICTED)) - return write_marked_file(answer, NULL, NORMAL, method); + return write_region_to_file(answer, NULL, NORMAL, method); else #endif return write_file(answer, NULL, NORMAL, method, ANNOTATE); diff --git a/src/prototypes.h b/src/prototypes.h index 07f8f75e..3fe5cd8a 100644 --- a/src/prototypes.h +++ b/src/prototypes.h @@ -294,11 +294,11 @@ bool outside_of_confinement(const char *currpath, bool allow_tabcomp); void init_backup_dir(void); #endif int copy_file(FILE *inn, FILE *out, bool close_out); -bool write_file(const char *name, FILE *thefile, bool tmp, - kind_of_writing_type method, bool fullbuffer); +bool write_file(const char *name, FILE *thefile, bool normal, + kind_of_writing_type method, bool annotate); #ifndef NANO_TINY -bool write_marked_file(const char *name, FILE *stream, bool tmp, - kind_of_writing_type method); +bool write_region_to_file(const char *name, FILE *stream, bool normal, + kind_of_writing_type method); #endif int do_writeout(bool exiting, bool withprompt); void do_writeout_void(void); diff --git a/src/text.c b/src/text.c index 1335374e..0dfe5500 100644 --- a/src/text.c +++ b/src/text.c @@ -2499,7 +2499,7 @@ void do_spell(void) #ifndef NANO_TINY if (openfile->mark) - okay = write_marked_file(temp_name, stream, TEMPORARY, OVERWRITE); + okay = write_region_to_file(temp_name, stream, TEMPORARY, OVERWRITE); else #endif okay = write_file(temp_name, stream, TEMPORARY, OVERWRITE, NONOTES);