summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-01-04 14:20:17 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-05 14:54:04 +0900
commit61fcf8e4971377efd27fd057aaad7980ddb9b59a (patch)
tree87b8cb60c08b29b485bde7075cdbba5d13ae5ea0
parent13d9f7ebcd5296f4d2ff6f8624c23b948932a59e (diff)
Evas filters: Fix crazy code (only when DEBUG=1)
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 1122befecf..9e4bdd2568 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -2253,26 +2253,23 @@ _lua_import_path_get(char *path, size_t len, const char *name)
2253 size_t r; 2253 size_t r;
2254 2254
2255#ifdef FILTERS_DEBUG 2255#ifdef FILTERS_DEBUG
2256 struct stat st;
2257 // This is a hack to fetch the most recent file from source 2256 // This is a hack to fetch the most recent file from source
2258 if (stat(path, &st) == -1) 2257 char *sep = evas_file_path_join("", "");
2259 { 2258 char *src = strdup(__FILE__);
2260 char *sep = evas_file_path_join("", ""); 2259 char *slash = strrchr(src, *sep);
2261 char *src = strdup(__FILE__); 2260 struct stat st;
2262 char *slash = strrchr(src, *sep); 2261 if (slash)
2263 if (slash) 2262 {
2264 { 2263 *slash = '\0';
2265 *slash = '\0'; 2264 if (*src == '/')
2266 if (*src == '/') 2265 r = snprintf(path, len - 1, "%s/lua/%s.lua", src, name);
2267 r = snprintf(path, len - 1, "%s/lua/%s.lua", src, name); 2266 else // abs_srcdir is unknown here
2268 else // abs_srcdir is unknown here 2267 r = snprintf(path, len - 1, "%s/src/%s/lua/%s.lua", PACKAGE_BUILD_DIR, src, name);
2269 r = snprintf(path, len - 1, "%s/src/%s/lua/%s.lua", PACKAGE_BUILD_DIR, src, name); 2268 if (r >= len) path[len - 1] = '\0';
2270 if (r >= len) path[len - 1] = '\0'; 2269 }
2271 } 2270 free(sep);
2272 free(sep); 2271 free(src);
2273 free(src); 2272 if (!stat(path, &st)) return;
2274 if (!stat(path, &st)) return;
2275 }
2276#endif 2273#endif
2277 2274
2278 r = snprintf(path, len - 1, "%s/filters/lua/%s.lua", pfx ? pfx : ".", name); 2275 r = snprintf(path, len - 1, "%s/filters/lua/%s.lua", pfx ? pfx : ".", name);