commit e90b7cf4aa5d55296c77da9eeb98fd11cc96073b
parent bb90de0eb4227e9643611ecd75ee18170b25176c
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 4 Aug 2018 11:34:44 +0200
tweaks: elide an unneeded/duplicate variable
Diffstat:
4 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -78,9 +78,7 @@ int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown;
#endif
#ifdef ENABLED_WRAPORJUSTIFY
-ssize_t fill = 0;
- /* The column where we will wrap lines. */
-ssize_t wrap_at = -COLUMNS_FROM_EOL;
+ssize_t fill = -COLUMNS_FROM_EOL;
/* The column where we will wrap lines. */
#endif
diff --git a/src/nano.c b/src/nano.c
@@ -718,7 +718,6 @@ void window_init(void)
#ifdef ENABLED_WRAPORJUSTIFY
/* Set up the wrapping point, accounting for screen width when negative. */
- fill = wrap_at;
if (fill <= 0)
fill += COLS;
if (fill < 0)
@@ -2246,7 +2245,7 @@ int main(int argc, char **argv)
#endif
#ifdef ENABLED_WRAPORJUSTIFY
case 'r':
- if (!parse_num(optarg, &wrap_at)) {
+ if (!parse_num(optarg, &fill)) {
fprintf(stderr, _("Requested fill size \"%s\" is invalid"), optarg);
fprintf(stderr, "\n");
exit(1);
@@ -2334,7 +2333,7 @@ int main(int argc, char **argv)
char *operating_dir_cpy = operating_dir;
#endif
#ifdef ENABLED_WRAPORJUSTIFY
- ssize_t wrap_at_cpy = wrap_at;
+ ssize_t fill_cpy = fill;
#endif
#ifndef NANO_TINY
char *backup_dir_cpy = backup_dir;
@@ -2382,7 +2381,7 @@ int main(int argc, char **argv)
#endif
#ifdef ENABLED_WRAPORJUSTIFY
if (fill_used)
- wrap_at = wrap_at_cpy;
+ fill = fill_cpy;
#endif
#ifndef NANO_TINY
if (backup_dir_cpy != NULL) {
diff --git a/src/proto.h b/src/proto.h
@@ -81,7 +81,6 @@ extern int shiftaltdown;
#ifdef ENABLED_WRAPORJUSTIFY
extern ssize_t fill;
-extern ssize_t wrap_at;
#endif
extern char *last_search;
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -1102,10 +1102,10 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
#endif
#ifdef ENABLED_WRAPORJUSTIFY
if (strcasecmp(rcopts[i].name, "fill") == 0) {
- if (!parse_num(option, &wrap_at)) {
+ if (!parse_num(option, &fill)) {
rcfile_error(N_("Requested fill size \"%s\" is invalid"),
option);
- wrap_at = -COLUMNS_FROM_EOL;
+ fill = -COLUMNS_FROM_EOL;
} else
UNSET(NO_WRAP);
free(option);