switch_to_prev_buffer(), rename open_nextfile_void()
switch_to_next_buffer(), remove load_file(), and remove
load_open_file(). (DLR)
+- files.c:
+ open_file()
+ - Assert that filename isn't NULL, and don't do anything special
+ if it's blank, as the the former case shouldn't occur, and the
+ latter case is now handled elsewhere. (DLR)
- global.c:
shortcut_init()
- Simplify wording of nano_gotoline_msg. (Jordi)
/* rc == -2 means that we have a new file. -1 means that the
* open() failed. 0 means that the open() succeeded. */
+ assert(filename != NULL);
+
#ifndef DISABLE_OPERATINGDIR
if (check_operating_dir(filename, FALSE)) {
statusbar(_("Can't insert file from outside of %s"),
}
#endif
- /* Open the file. */
- rc = open_file(filename, new_buffer, &f);
+ /* If the filename isn't blank, open the file. */
+ if (filename[0] != '\0')
+ rc = open_file(filename, new_buffer, &f);
/* If we're loading into a new buffer, add a new openfile entry. */
if (new_buffer)
int fd;
struct stat fileinfo;
- assert(f != NULL);
+ assert(filename != NULL && f != NULL);
- if (filename == NULL || filename[0] == '\0' ||
- stat(filename, &fileinfo) == -1) {
+ if (stat(filename, &fileinfo) == -1) {
if (newfie) {
statusbar(_("New File"));
return -2;