Rename io_file_exist{,s}()
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
98fb747e6a
commit
beac8bdd9b
@ -507,7 +507,7 @@ static inline void key_generic_cmd(void)
|
|||||||
topic_res = "intro";
|
topic_res = "intro";
|
||||||
snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic_res);
|
snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic_res);
|
||||||
|
|
||||||
if (!io_file_exist(path) && keys_str2int(topic_res) > 0 &&
|
if (!io_file_exists(path) && keys_str2int(topic_res) > 0 &&
|
||||||
keys_get_action(keys_str2int(topic_res)) > 0) {
|
keys_get_action(keys_str2int(topic_res)) > 0) {
|
||||||
int ch = keys_str2int(topic_res);
|
int ch = keys_str2int(topic_res);
|
||||||
enum key action = keys_get_action(ch);
|
enum key action = keys_get_action(ch);
|
||||||
@ -515,7 +515,7 @@ static inline void key_generic_cmd(void)
|
|||||||
snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic_res);
|
snprintf(path, BUFSIZ, DOCDIR "/%s.txt", topic_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!io_file_exist(path)) {
|
if (!io_file_exists(path)) {
|
||||||
if (!strcmp(topic_res, "generic-credits"))
|
if (!strcmp(topic_res, "generic-credits"))
|
||||||
topic_res = "credits";
|
topic_res = "credits";
|
||||||
else if (!strcmp(topic_res, "generic-help"))
|
else if (!strcmp(topic_res, "generic-help"))
|
||||||
@ -598,7 +598,7 @@ static inline void key_generic_cmd(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (io_file_exist(path)) {
|
if (io_file_exists(path)) {
|
||||||
wins_launch_external(path, conf.pager);
|
wins_launch_external(path, conf.pager);
|
||||||
} else {
|
} else {
|
||||||
char error_msg[BUFSIZ];
|
char error_msg[BUFSIZ];
|
||||||
|
@ -754,7 +754,7 @@ void io_load_app(void);
|
|||||||
void io_load_todo(void);
|
void io_load_todo(void);
|
||||||
void io_load_keys(const char *);
|
void io_load_keys(const char *);
|
||||||
int io_check_dir(const char *);
|
int io_check_dir(const char *);
|
||||||
unsigned io_file_exist(const char *);
|
unsigned io_file_exists(const char *);
|
||||||
int io_check_file(const char *);
|
int io_check_file(const char *);
|
||||||
int io_check_data_files(void);
|
int io_check_data_files(void);
|
||||||
void io_startup_screen(int);
|
void io_startup_screen(int);
|
||||||
|
@ -152,12 +152,12 @@ void dmon_start(int parent_exit_status)
|
|||||||
if (!io_dump_pid(path_dpid))
|
if (!io_dump_pid(path_dpid))
|
||||||
DMON_ABRT(_("Could not set lock file\n"));
|
DMON_ABRT(_("Could not set lock file\n"));
|
||||||
|
|
||||||
if (!io_file_exist(path_conf))
|
if (!io_file_exists(path_conf))
|
||||||
DMON_ABRT(_("Could not access \"%s\": %s\n"), path_conf,
|
DMON_ABRT(_("Could not access \"%s\": %s\n"), path_conf,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
config_load();
|
config_load();
|
||||||
|
|
||||||
if (!io_file_exist(path_apts))
|
if (!io_file_exists(path_apts))
|
||||||
DMON_ABRT(_("Could not access \"%s\": %s\n"), path_apts,
|
DMON_ABRT(_("Could not access \"%s\": %s\n"), path_apts,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
apoint_llist_init();
|
apoint_llist_init();
|
||||||
|
4
src/io.c
4
src/io.c
@ -872,7 +872,7 @@ int io_check_dir(const char *dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned io_file_exist(const char *file)
|
unsigned io_file_exists(const char *file)
|
||||||
{
|
{
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
|
||||||
@ -890,7 +890,7 @@ int io_check_file(const char *file)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
if (io_file_exist(file)) {
|
if (io_file_exists(file)) {
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
FILE *fd;
|
FILE *fd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user