diff --git a/ChangeLog b/ChangeLog index 903c394922311b1b67bb33c958f4ec5cb67adbd4..e293fd56696facc86589e65afc18457c4033a176 100644 --- a/ChangeLog +++ b/ChangeLog @@ -103,6 +103,9 @@ CVS code - - Set i to 0 when we get a filename via the file browser, so that it's read in properly when we exit the file browser. (DLR) + open_prevnext_file() + - Move up a misplaced assert. (DLR) + - Rename variable next to next_file, to avoid confusion. (DLR) write_file() - Since lineswritten is a size_t, print its value as an unsigned long instead of an unsigned int. (DLR) diff --git a/src/files.c b/src/files.c index f343cf048987c4a9246a5bcdc374eb79121501aa..a6edfe0ed571b1bd5b62686d5e9d2961d2a33b73 100644 --- a/src/files.c +++ b/src/files.c @@ -912,12 +912,12 @@ void load_open_file(void) } /* Open either the next or previous file buffer. */ -void open_prevnext_file(bool next) +void open_prevnext_file(bool next_file) { - add_open_file(TRUE); - assert(open_files != NULL); + add_open_file(TRUE); + /* If only one file buffer is open, indicate it on the statusbar and * get out. */ if (open_files == open_files->next) { @@ -927,7 +927,7 @@ void open_prevnext_file(bool next) /* Switch to the next or previous file, depending on the value of * next. */ - open_files = next ? open_files->next : open_files->prev; + open_files = next_file ? open_files->next : open_files->prev; #ifdef DEBUG fprintf(stderr, "filename is %s\n", open_files->filename); diff --git a/src/proto.h b/src/proto.h index bd4592b0d348e016aac8929fee8588c8ea83a18e..fdbaf8e2413dd9135ae69f8c6cbaba4fc653b16e 100644 --- a/src/proto.h +++ b/src/proto.h @@ -277,7 +277,7 @@ void free_openfilestruct(openfilestruct *src); #endif void add_open_file(bool update); void load_open_file(void); -void open_prevnext_file(bool next); +void open_prevnext_file(bool next_file); void open_prevfile_void(void); void open_nextfile_void(void); bool close_open_file(void);