- 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
- 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
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. */
#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;
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 */
* 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;
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,
break;
#endif
case 't':
- SET(TEMP_OPT);
+ SET(TEMP_FILE);
break;
case 'v':
SET(VIEW_MODE);
#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)
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;
#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 */
#endif
{"suspend", SUSPEND},
{"tabsize", 0},
- {"tempfile", TEMP_OPT},
+ {"tempfile", TEMP_FILE},
{"view", VIEW_MODE},
#ifndef NANO_SMALL
{"whitespace", 0},
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);
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];
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.
}
regexp_cleanup();
- flags = flagsave;
+ flags = flags_save;
}
#endif