diff --git a/ChangeLog b/ChangeLog index 4379458e..f9e74481 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,15 +18,19 @@ CVS code - open_buffer(), rename load_open_file() load_buffer(), rename open_prevnext_file() switch_to_prevnext_buffer(), rename open_prevfile_void() switch_to_prev_buffer(), rename - open_nextfile_void() switch_to_next_buffer(), remove - load_file(), rename cancel_fork() cancel_command(), - rename open_pipe() execute_command(), remove - execute_command(), and remove resize_variables(). (DLR) + open_nextfile_void() switch_to_next_buffer(), rename + write_marked() write_marked_file(), remove load_file(), rename + cancel_fork() cancel_command(), rename open_pipe() + execute_command(), remove execute_command(), and remove + resize_variables(). (DLR) - Replace all mvwaddstr(hblank) calls with a new function that does the same thing without the need for hblank. New function blank_line(); changes to do_browser(), blank_titlebar(), blank_topbar(), blank_edit(), blank_statusbar(), blank_bottombars(), update_line(), and edit_refresh(). (DLR) + - Make the static pid variable used by execute_command() and + cancel_command() a pid_t instead of an int, for consistency. + (DLR) - files.c: open_file() - Assert that filename isn't NULL, and don't do anything special diff --git a/src/files.c b/src/files.c index a134d890..1013cd1f 100644 --- a/src/files.c +++ b/src/files.c @@ -130,13 +130,8 @@ void initialize_buffer(void) openfile->current = openfile->fileage; openfile->current_x = 0; - openfile->current_y = 0; openfile->placewewant = 0; - -#ifndef NANO_SMALL - openfile->mark_begin = NULL; - openfile->mark_begin_x = 0; -#endif + openfile->current_y = 0; openfile->totlines = 1; openfile->totsize = 0; @@ -145,6 +140,9 @@ void initialize_buffer(void) #ifndef NANO_SMALL openfile->mark_set = FALSE; + openfile->mark_begin = NULL; + openfile->mark_begin_x = 0; + openfile->fmt = NIX_FILE; memset(&openfile->originalfilestat, 0, sizeof(struct stat)); @@ -1593,7 +1591,8 @@ int write_file(const char *name, FILE *f_open, bool tmp, int append, * with nonamechange set to TRUE so that we don't change the current * filename. Finally, set fileage and filebot back to their old values * and return. */ -int write_marked(const char *name, FILE *f_open, bool tmp, int append) +int write_marked_file(const char *name, FILE *f_open, bool tmp, int + append) { int retval = -1; bool old_modified = openfile->modified; @@ -1784,7 +1783,7 @@ int do_writeout(bool exiting) * disabled since it allows reading from or writing to files * not specified on the command line. */ if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set) - retval = write_marked(answer, NULL, FALSE, append); + retval = write_marked_file(answer, NULL, FALSE, append); else #endif /* !NANO_SMALL */ retval = write_file(answer, NULL, FALSE, append, FALSE); diff --git a/src/nano.c b/src/nano.c index 7fffdf64..c2e31292 100644 --- a/src/nano.c +++ b/src/nano.c @@ -67,7 +67,7 @@ static struct sigaction act; /* For all our fun signal handlers */ #ifndef NANO_SMALL static sigjmp_buf jmpbuf; /* Used to return to main() after a SIGWINCH. */ -static int pid; /* The PID of the newly forked process +static pid_t pid; /* The PID of the newly forked process * in execute_command(). It must be * global because the signal handler * needs it. */ @@ -2540,7 +2540,7 @@ void do_spell(void) #ifndef NANO_SMALL if (openfile->mark_set) - i = write_marked(temp, temp_file, TRUE, FALSE); + i = write_marked_file(temp, temp_file, TRUE, FALSE); else #endif i = write_file(temp, temp_file, TRUE, FALSE, FALSE); diff --git a/src/nano.h b/src/nano.h index 73ab655a..705726a6 100644 --- a/src/nano.h +++ b/src/nano.h @@ -168,15 +168,9 @@ typedef struct openfilestruct { filestruct *current; /* Current file's line. */ size_t current_x; /* Current file's x-coordinate * position. */ + size_t placewewant; /* Current file's place we want. */ ssize_t current_y; /* Current file's y-coordinate * position. */ - size_t placewewant; /* Current file's place we want. */ -#ifndef NANO_SMALL - filestruct *mark_begin; /* Current file's beginning marked - * line. */ - size_t mark_begin_x; /* Current file's beginning marked - * line's x-coordinate position. */ -#endif size_t totlines; /* Current file's total number of * lines. */ size_t totsize; /* Current file's total size. */ @@ -184,6 +178,10 @@ typedef struct openfilestruct { * status. */ #ifndef NANO_SMALL bool mark_set; /* Current file's marking status. */ + filestruct *mark_begin; /* Current file's beginning marked + * line. */ + size_t mark_begin_x; /* Current file's beginning marked + * line's x-coordinate position. */ file_format fmt; /* Current file's format. */ struct stat originalfilestat; /* Current file's stat. */ diff --git a/src/proto.h b/src/proto.h index ba6cb7bd..189c20ac 100644 --- a/src/proto.h +++ b/src/proto.h @@ -277,7 +277,8 @@ int copy_file(FILE *inn, FILE *out); int write_file(const char *name, FILE *f_open, bool tmp, int append, bool nonamechange); #ifndef NANO_SMALL -int write_marked(const char *name, FILE *f_open, bool tmp, int append); +int write_marked_file(const char *name, FILE *f_open, bool tmp, int + append); #endif int do_writeout(bool exiting); void do_writeout_void(void);