diff options
author | Robert Manea <gotmor@gmail.com> | 2009-09-25 15:11:56 +0200 |
---|---|---|
committer | Robert Manea <gotmor@gmail.com> | 2009-09-25 15:11:56 +0200 |
commit | e32072de883f273ea76148370fc37a29d69a8680 (patch) | |
tree | 593f534d4029e899df8e1d2b9787068d86a1b57f /uzbl-core.c | |
parent | 395d6b5db2ffe9696659492287fdf8daafb1b276 (diff) |
added space and / stripping to find_existing_file()
Diffstat (limited to 'uzbl-core.c')
-rw-r--r-- | uzbl-core.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/uzbl-core.c b/uzbl-core.c index 4055ee8..a14c7ef 100644 --- a/uzbl-core.c +++ b/uzbl-core.c @@ -550,6 +550,7 @@ find_existing_file(gchar* path_list) { int cnt; gchar **split; gchar *tmp = NULL; + gchar *executable; if(!path_list) return NULL; @@ -567,8 +568,16 @@ find_existing_file(gchar* path_list) { cnt = i-1; i=0; + tmp = g_strdup(split[cnt]); + g_strstrip(tmp); + if(tmp[0] == '/') + executable = g_strdup_printf("%s", tmp+1); + else + executable = g_strdup(tmp); + g_free(tmp); + while(i<cnt) { - tmp = g_strconcat(split[i], "/", split[cnt], NULL); + tmp = g_strconcat(g_strstrip(split[i]), "/", executable, NULL); if(g_file_test(tmp, G_FILE_TEST_EXISTS)) { g_strfreev(split); return tmp; |