diff --git a/ChangeLog b/ChangeLog
index 9fbdffbe66cd9685b4dffb5f335d728e61920d5f..e69e30ec9bb3008e83040855285761e2531b47e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,10 +6,14 @@ CVS code -
 	- Change more instances of ints that can never be negative to
 	  size_t's. (DLR)
 	- Convert the shortcut list functions and most related functions
-	  to return void instead of int, as the return values of all 
+	  to return void instead of int, as the return values of all
 	  those functions are essentially unused.  Changes to
 	  sc_init_one(), shortcut_init(), etc. (David Benbennick and
 	  DLR)
+	- Make flags and all variables meant to store the value of flags
+	  longs for consistency. (David Benbennick)
+	- Rename the TEMP_OPT flags to TEMP_FILE, as it's more 
+	  descriptive. (DLR)
 - files.c:
   close_open_file()
 	- Tweak to no longer rely on the return values of
@@ -25,10 +29,14 @@ CVS code -
 	- Change the last variables in the prototypes for do_justify()
 	  and get_mouseinput() to match the ones used in the actual
 	  functions. (DLR)
+	- Remove unused declaration of temp_opt. (David Benbennick)
 - rcfile.c:
   parse_rcfile()
 	- Have whitespace display default to off instead of on. (Mike
 	  Frysinger)
+  nregcomp()
+	- Rename the variable flags to eflags so as not to conflict with
+	  the global flags. (DLR)
 - winio.c:
   get_control_kbinput()
 	- Fix erroneous debugging statement so that nano compiles with
diff --git a/src/files.c b/src/files.c
index 8f0b7837d5a0ac467e145b0da633455cb30bb111..abc0cfbe2c3c32482361200464d78b07e9d6c486 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1794,7 +1794,7 @@ int do_writeout(int exiting)
     currshortcut = writefile_list;
 #endif
 
-    if (exiting && filename[0] != '\0' && ISSET(TEMP_OPT)) {
+    if (exiting && filename[0] != '\0' && ISSET(TEMP_FILE)) {
 	i = write_file(filename, FALSE, 0, FALSE);
 	if (i == 1) {
 	    /* Write succeeded. */
@@ -1901,7 +1901,7 @@ int do_writeout(int exiting)
 #endif
 
 #ifdef NANO_EXTRA
-	if (exiting && !ISSET(TEMP_OPT) && !strcasecmp(answer, "zzy")
+	if (exiting && !ISSET(TEMP_FILE) && !strcasecmp(answer, "zzy")
 		&& !did_cred) {
 	    do_credits();
 	    did_cred = TRUE;
diff --git a/src/global.c b/src/global.c
index 50ab559c3c8fd1ca0f730d9ea7ccc86f2e502e13..15f87d65d411fbf62a75fd905a3865f7f3ea8499 100644
--- a/src/global.c
+++ b/src/global.c
@@ -39,7 +39,7 @@ char *last_replace = NULL;	/* Last replacement string */
 int search_last_line;		/* Is this the last search line? */
 int search_offscreen;		/* Search lines not displayed */
 
-int flags = 0;			/* Our new flag containing many options */
+long flags = 0;			/* Our flag containing many options */
 WINDOW *edit;			/* The file portion of the editor */
 WINDOW *topwin;			/* Top line of screen */
 WINDOW *bottomwin;		/* Bottom buffer */
diff --git a/src/nano.c b/src/nano.c
index c49c06d3f7258b1647d4a46e1d459abd358db355..f5f2df83a9837bcef35a4271589cee2ffad72370 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2387,7 +2387,7 @@ void do_justify(int full_justify)
      * unjustifies.  Note we don't need to save totlines. */
     int current_x_save = current_x;
     int current_y_save = current_y;
-    int flags_save = flags;
+    long flags_save = flags;
     long totsize_save = totsize;
     filestruct *current_save = current;
     filestruct *edittop_save = edittop;
@@ -2715,7 +2715,7 @@ void do_exit(void)
 
     if (!ISSET(MODIFIED))
 	i = 0;		/* Pretend the user chose not to save. */
-    else if (ISSET(TEMP_OPT))
+    else if (ISSET(TEMP_FILE))
 	i = 1;
     else
 	i = do_yesno(FALSE,
@@ -3234,7 +3234,7 @@ int main(int argc, char *argv[])
 	    break;
 #endif
 	case 't':
-	    SET(TEMP_OPT);
+	    SET(TEMP_FILE);
 	    break;
 	case 'v':
 	    SET(VIEW_MODE);
diff --git a/src/nano.h b/src/nano.h
index 1ef4f1379273746e2e1f51c64fe6dde5d8d214e3..669c172cbdf40c63d012f3dc6cbf17aaba887727 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -264,7 +264,7 @@ typedef struct historyheadtype {
 #define VIEW_MODE		(1<<9)
 #define USE_MOUSE		(1<<10)
 #define USE_REGEXP		(1<<11)
-#define TEMP_OPT		(1<<12)
+#define TEMP_FILE		(1<<12)
 #define CUT_TO_END		(1<<13)
 #define REVERSE_SEARCH		(1<<14)
 #define MULTIBUFFER		(1<<15)
diff --git a/src/proto.h b/src/proto.h
index 89ca63f916632819ca8a90de2420f91e06f655ad..f65a1a53fb60ab4ddb28e29695389fae37118754 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -39,8 +39,7 @@ extern int placewewant;
 extern int mark_beginx;
 #endif
 extern long totsize;
-extern int temp_opt;
-extern int flags;
+extern long flags;
 extern int tabsize;
 extern int search_last_line;
 extern int search_offscreen;
@@ -370,7 +369,7 @@ char *parse_argument(char *ptr);
 #ifdef ENABLE_COLOR
 int colortoint(const char *colorname, int *bright);
 char *parse_next_regex(char *ptr);
-int nregcomp(regex_t *preg, const char *regex, int flags);
+int nregcomp(regex_t *preg, const char *regex, int eflags);
 void parse_syntax(char *ptr);
 void parse_colors(char *ptr);
 #endif /* ENABLE_COLOR */
diff --git a/src/rcfile.c b/src/rcfile.c
index de5ec4a14429c9d17a445d84b1facb538f642e38..e25fd2593dbe11a4aa6de03ee06980016688d7ec 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -92,7 +92,7 @@ const static rcoption rcopts[] = {
 #endif
     {"suspend", SUSPEND},
     {"tabsize", 0},
-    {"tempfile", TEMP_OPT},
+    {"tempfile", TEMP_FILE},
     {"view", VIEW_MODE},
 #ifndef NANO_SMALL
     {"whitespace", 0},
@@ -253,11 +253,11 @@ char *parse_next_regex(char *ptr)
     return ptr;
 }
 
-/* Compile the regular expression regex to preg.  Returns FALSE on success,
-   TRUE if the expression is invalid. */
-int nregcomp(regex_t *preg, const char *regex, int flags)
+/* Compile the regular expression regex to preg.  Returns FALSE on
+ * success, or TRUE if the expression is invalid. */
+int nregcomp(regex_t *preg, const char *regex, int eflags)
 {
-    int rc = regcomp(preg, regex, REG_EXTENDED | flags);
+    int rc = regcomp(preg, regex, REG_EXTENDED | eflags);
 
     if (rc != 0) {
 	size_t len = regerror(rc, preg, NULL, 0);
diff --git a/src/search.c b/src/search.c
index 55f295b371fb4b12ee0df06066fd746ee77067e3..0a0c891793c5eaac6a7da6729727251d2b17d62a 100644
--- a/src/search.c
+++ b/src/search.c
@@ -899,7 +899,8 @@ void do_find_bracket(void)
     char ch_under_cursor, wanted_ch;
     const char *pos, *brackets = "([{<>}])";
     char regexp_pat[] = "[  ]";
-    int old_pww = placewewant, current_x_save, flagsave, count = 1;
+    int old_pww = placewewant, current_x_save, count = 1;
+    long flags_save;
     filestruct *current_save;
 
     ch_under_cursor = current->data[current_x];
@@ -915,7 +916,7 @@ void do_find_bracket(void)
 
     current_x_save = current_x;
     current_save = current;
-    flagsave = flags;
+    flags_save = flags;
     SET(USE_REGEXP);
 
     /* Apparent near redundancy with regexp_pat[] here is needed.
@@ -958,7 +959,7 @@ void do_find_bracket(void)
     }
 
     regexp_cleanup();
-    flags = flagsave;
+    flags = flags_save;
 }
 #endif