commit 2ee2407e6365314463cceed11ecbae2158dac65c
parent 5ca444e5df8172f1929ae42101f138b793e821cd
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sun, 30 Sep 2018 10:33:43 +0200
tweaks: reshuffle some lines, to put things in order of option name
Diffstat:
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2318,9 +2318,6 @@ int main(int argc, char **argv)
#ifdef ENABLE_NANORC
if (!no_rcfiles) {
/* Back up the command-line options, then read the rcfile(s). */
-#ifdef ENABLE_OPERATINGDIR
- char *operating_dir_cpy = operating_dir;
-#endif
#ifdef ENABLED_WRAPORJUSTIFY
ssize_t fill_cpy = fill;
#endif
@@ -2328,6 +2325,9 @@ int main(int argc, char **argv)
char *backup_dir_cpy = backup_dir;
char *word_chars_cpy = word_chars;
#endif
+#ifdef ENABLE_OPERATINGDIR
+ char *operating_dir_cpy = operating_dir;
+#endif
#ifdef ENABLE_JUSTIFY
char *quotestr_cpy = quotestr;
#endif
@@ -2340,13 +2340,13 @@ int main(int argc, char **argv)
memcpy(flags_cpy, flags, sizeof(flags_cpy));
-#ifdef ENABLE_OPERATINGDIR
- operating_dir = NULL;
-#endif
#ifndef NANO_TINY
backup_dir = NULL;
word_chars = NULL;
#endif
+#ifdef ENABLE_OPERATINGDIR
+ operating_dir = NULL;
+#endif
#ifdef ENABLE_JUSTIFY
quotestr = NULL;
#endif
@@ -2362,12 +2362,6 @@ int main(int argc, char **argv)
#endif
/* If the backed-up command-line options have a value, restore them. */
-#ifdef ENABLE_OPERATINGDIR
- if (operating_dir_cpy != NULL || ISSET(RESTRICTED)) {
- free(operating_dir);
- operating_dir = operating_dir_cpy;
- }
-#endif
#ifdef ENABLED_WRAPORJUSTIFY
if (fill_used)
fill = fill_cpy;
@@ -2382,6 +2376,12 @@ int main(int argc, char **argv)
word_chars = word_chars_cpy;
}
#endif
+#ifdef ENABLE_OPERATINGDIR
+ if (operating_dir_cpy != NULL || ISSET(RESTRICTED)) {
+ free(operating_dir);
+ operating_dir = operating_dir_cpy;
+ }
+#endif
#ifdef ENABLE_JUSTIFY
if (quotestr_cpy != NULL) {
free(quotestr);