read. Changes to sc_init_one(), toggle_init(),
toggle_init_one(), shortcut_init(), get_toggle(), and
help_init(). (DLR, suggested by Benno Schulenberg)
+ - Reduce NO_RCFILE to a static bool in nano.c, since it's only
+ used there. Changes to finish() and main(). (DLR)
- files.c:
open_file()
- Remove redundant wording in the error message when we try to
#include <setjmp.h>
#endif
+#ifdef ENABLE_NANORC
+static bool no_rcfiles = FALSE;
+ /* Should we ignore all rcfiles? */
+#endif
static struct termios oldterm;
/* The user's original terminal settings. */
static struct sigaction act;
tcsetattr(0, TCSANOW, &oldterm);
#if !defined(NANO_TINY) && defined(ENABLE_NANORC)
- if (!ISSET(NO_RCFILE) && ISSET(HISTORYLOG))
+ if (!no_rcfiles && ISSET(HISTORYLOG))
save_history();
#endif
break;
#endif
case 'I':
- SET(NO_RCFILE);
+ no_rcfiles = TRUE;
break;
#endif
case 'K':
if (ISSET(RESTRICTED)) {
UNSET(SUSPEND);
UNSET(BACKUP_FILE);
- SET(NO_RCFILE);
+ no_rcfiles = TRUE;
}
/* We've read through the command line options. Now back up the flags
* and values that are set, and read the rcfile(s). If the values
* haven't changed afterward, restore the backed-up values. */
#ifdef ENABLE_NANORC
- if (!ISSET(NO_RCFILE)) {
+ if (!no_rcfiles) {
#ifndef DISABLE_OPERATINGDIR
char *operating_dir_cpy = operating_dir;
#endif
/* Set up the search/replace history. */
history_init();
#ifdef ENABLE_NANORC
- if (!ISSET(NO_RCFILE) && ISSET(HISTORYLOG))
+ if (!no_rcfiles && ISSET(HISTORYLOG))
load_history();
#endif
#endif
#define REBIND_KEYPAD (1<<16)
#define NO_CONVERT (1<<17)
#define BACKUP_FILE (1<<18)
-#define NO_RCFILE (1<<19)
-#define NO_COLOR_SYNTAX (1<<20)
-#define PRESERVE (1<<21)
-#define HISTORYLOG (1<<22)
-#define RESTRICTED (1<<23)
-#define SMART_HOME (1<<24)
-#define WHITESPACE_DISPLAY (1<<25)
-#define MORE_SPACE (1<<26)
-#define TABS_TO_SPACES (1<<27)
-#define QUICK_BLANK (1<<28)
-#define WORD_BOUNDS (1<<29)
-#define NO_NEWLINES (1<<30)
-#define BOLD_TEXT (1<<31)
+#define NO_COLOR_SYNTAX (1<<19)
+#define PRESERVE (1<<20)
+#define HISTORYLOG (1<<21)
+#define RESTRICTED (1<<22)
+#define SMART_HOME (1<<23)
+#define WHITESPACE_DISPLAY (1<<24)
+#define MORE_SPACE (1<<25)
+#define TABS_TO_SPACES (1<<26)
+#define QUICK_BLANK (1<<27)
+#define WORD_BOUNDS (1<<28)
+#define NO_NEWLINES (1<<29)
+#define BOLD_TEXT (1<<30)
/* Control key sequences. Changing these would be very, very bad. */
#define NANO_CONTROL_SPACE 0