aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar keis <keijser@gmail.com>2011-05-15 00:26:34 +0200
committerGravatar keis <keijser@gmail.com>2011-05-15 00:26:34 +0200
commit6672b88cf8c02fe2d03b15780996a75a6158ff0a (patch)
tree6a31631772bb066790043753b37567b5e70cbd8d /src/util.c
parented8f45d6eb21e5a931d55235708bcc73a2191771 (diff)
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.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c2
1 files changed, 1 insertions, 1 deletions
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++;