From 6672b88cf8c02fe2d03b15780996a75a6158ff0a Mon Sep 17 00:00:00 2001 From: keis Date: Sun, 15 May 2011 00:26:34 +0200 Subject: Check if file exist before trying to run it find_existing_file modified to return NULL when file does not exist even for simple paths. run_external_js and spawn prints error messages when a file could not be loaded. --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 8f6c349..42ae39e 100644 --- a/src/util.c +++ b/src/util.c @@ -134,7 +134,7 @@ find_existing_file(const gchar* path_list) { char *basename = strrchr(path_list_dup, ':'); if(!basename) - return path_list_dup; + return file_exists(path_list_dup) ? path_list_dup : NULL; basename[0] = '\0'; basename++; -- cgit v1.2.3