bim: Report errors when opening files
This commit is contained in:
parent
14ae8e37d8
commit
a6f063b06d
|
@ -3842,6 +3842,12 @@ void open_file(char * file) {
|
|||
}
|
||||
f = fopen(_file, "r");
|
||||
if (file != _file) free(_file);
|
||||
if (!f && errno != ENOENT) {
|
||||
render_error("%s: %s", file, strerror(errno));
|
||||
pause_for_key();
|
||||
close_buffer();
|
||||
return;
|
||||
}
|
||||
env->file_name = strdup(file);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <dirent.h>
|
||||
#include <poll.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
|
|
Loading…
Reference in New Issue