still more breakage fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2837 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
dbcaa3b1fb
commit
76c25f582a
|
@ -20,6 +20,11 @@ CVS code -
|
|||
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)
|
||||
|
|
12
src/files.c
12
src/files.c
|
@ -157,6 +157,8 @@ void open_buffer(const char *filename)
|
|||
/* 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"),
|
||||
|
@ -165,8 +167,9 @@ void open_buffer(const char *filename)
|
|||
}
|
||||
#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)
|
||||
|
@ -534,10 +537,9 @@ int open_file(const char *filename, bool newfie, FILE **f)
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue