miscellaneous minor fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2851 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2005-07-12 20:09:24 +00:00
parent 5128de8308
commit 222b201afe
5 changed files with 24 additions and 22 deletions

View File

@ -18,15 +18,19 @@ CVS code -
open_buffer(), rename load_open_file() load_buffer(), rename open_buffer(), rename load_open_file() load_buffer(), rename
open_prevnext_file() switch_to_prevnext_buffer(), rename open_prevnext_file() switch_to_prevnext_buffer(), rename
open_prevfile_void() switch_to_prev_buffer(), rename open_prevfile_void() switch_to_prev_buffer(), rename
open_nextfile_void() switch_to_next_buffer(), remove open_nextfile_void() switch_to_next_buffer(), rename
load_file(), rename cancel_fork() cancel_command(), write_marked() write_marked_file(), remove load_file(), rename
rename open_pipe() execute_command(), remove cancel_fork() cancel_command(), rename open_pipe()
execute_command(), and remove resize_variables(). (DLR) execute_command(), remove execute_command(), and remove
resize_variables(). (DLR)
- Replace all mvwaddstr(hblank) calls with a new function that - Replace all mvwaddstr(hblank) calls with a new function that
does the same thing without the need for hblank. New function does the same thing without the need for hblank. New function
blank_line(); changes to do_browser(), blank_titlebar(), blank_line(); changes to do_browser(), blank_titlebar(),
blank_topbar(), blank_edit(), blank_statusbar(), blank_topbar(), blank_edit(), blank_statusbar(),
blank_bottombars(), update_line(), and edit_refresh(). (DLR) 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: - files.c:
open_file() open_file()
- Assert that filename isn't NULL, and don't do anything special - Assert that filename isn't NULL, and don't do anything special

View File

@ -130,13 +130,8 @@ void initialize_buffer(void)
openfile->current = openfile->fileage; openfile->current = openfile->fileage;
openfile->current_x = 0; openfile->current_x = 0;
openfile->current_y = 0;
openfile->placewewant = 0; openfile->placewewant = 0;
openfile->current_y = 0;
#ifndef NANO_SMALL
openfile->mark_begin = NULL;
openfile->mark_begin_x = 0;
#endif
openfile->totlines = 1; openfile->totlines = 1;
openfile->totsize = 0; openfile->totsize = 0;
@ -145,6 +140,9 @@ void initialize_buffer(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
openfile->mark_set = FALSE; openfile->mark_set = FALSE;
openfile->mark_begin = NULL;
openfile->mark_begin_x = 0;
openfile->fmt = NIX_FILE; openfile->fmt = NIX_FILE;
memset(&openfile->originalfilestat, 0, sizeof(struct stat)); 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 * with nonamechange set to TRUE so that we don't change the current
* filename. Finally, set fileage and filebot back to their old values * filename. Finally, set fileage and filebot back to their old values
* and return. */ * 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; int retval = -1;
bool old_modified = openfile->modified; bool old_modified = openfile->modified;
@ -1784,7 +1783,7 @@ int do_writeout(bool exiting)
* disabled since it allows reading from or writing to files * disabled since it allows reading from or writing to files
* not specified on the command line. */ * not specified on the command line. */
if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set) if (!ISSET(RESTRICTED) && !exiting && openfile->mark_set)
retval = write_marked(answer, NULL, FALSE, append); retval = write_marked_file(answer, NULL, FALSE, append);
else else
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
retval = write_file(answer, NULL, FALSE, append, FALSE); retval = write_file(answer, NULL, FALSE, append, FALSE);

View File

@ -67,7 +67,7 @@ static struct sigaction act; /* For all our fun signal handlers */
#ifndef NANO_SMALL #ifndef NANO_SMALL
static sigjmp_buf jmpbuf; /* Used to return to main() after a static sigjmp_buf jmpbuf; /* Used to return to main() after a
SIGWINCH. */ 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 * in execute_command(). It must be
* global because the signal handler * global because the signal handler
* needs it. */ * needs it. */
@ -2540,7 +2540,7 @@ void do_spell(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (openfile->mark_set) if (openfile->mark_set)
i = write_marked(temp, temp_file, TRUE, FALSE); i = write_marked_file(temp, temp_file, TRUE, FALSE);
else else
#endif #endif
i = write_file(temp, temp_file, TRUE, FALSE, FALSE); i = write_file(temp, temp_file, TRUE, FALSE, FALSE);

View File

@ -168,15 +168,9 @@ typedef struct openfilestruct {
filestruct *current; /* Current file's line. */ filestruct *current; /* Current file's line. */
size_t current_x; /* Current file's x-coordinate size_t current_x; /* Current file's x-coordinate
* position. */ * position. */
size_t placewewant; /* Current file's place we want. */
ssize_t current_y; /* Current file's y-coordinate ssize_t current_y; /* Current file's y-coordinate
* position. */ * 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 size_t totlines; /* Current file's total number of
* lines. */ * lines. */
size_t totsize; /* Current file's total size. */ size_t totsize; /* Current file's total size. */
@ -184,6 +178,10 @@ typedef struct openfilestruct {
* status. */ * status. */
#ifndef NANO_SMALL #ifndef NANO_SMALL
bool mark_set; /* Current file's marking status. */ 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. */ file_format fmt; /* Current file's format. */
struct stat originalfilestat; struct stat originalfilestat;
/* Current file's stat. */ /* Current file's stat. */

View File

@ -277,7 +277,8 @@ int copy_file(FILE *inn, FILE *out);
int write_file(const char *name, FILE *f_open, bool tmp, int append, int write_file(const char *name, FILE *f_open, bool tmp, int append,
bool nonamechange); bool nonamechange);
#ifndef NANO_SMALL #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 #endif
int do_writeout(bool exiting); int do_writeout(bool exiting);
void do_writeout_void(void); void do_writeout_void(void);