summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-29 09:18:20 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-29 12:29:03 -0400
commitfb63dfae77ba4c2aa1956d5cb7945fad785bd80a (patch)
tree0d7be5108cf25ab5a9f4c26dc69926aa3344b0b1
parent210ea6a8081753726c34ff61e97b0dfbd2c0e52a (diff)
elm: fix value of datadir when running in tree
Summary: this makes it possible to successfully run elm_test out of the tree without installing @fix Depends on D8965 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8966
-rw-r--r--src/lib/elementary/elm_main.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 477411e3ac..ca03e4bab6 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -587,7 +587,22 @@ elm_app_data_dir_get(void)
587 if (app_data_dir) return app_data_dir; 587 if (app_data_dir) return app_data_dir;
588 _prefix_check(); 588 _prefix_check();
589 if (!app_pfx) return ""; 589 if (!app_pfx) return "";
590 app_data_dir = eina_prefix_data_get(app_pfx); 590 /* only used to run inside efl src tree */
591 if (getenv("EFL_RUN_IN_TREE"))
592 {
593 /* "/some/path/to/repo/build/src" */
594 const char *path = elm_app_prefix_dir_get();
595 /* "/some/path/to/repo/build/" */
596 const char *last_sep = strrchr(path, '/');
597 Eina_Strbuf *buf = eina_strbuf_new();
598 eina_strbuf_append_length(buf, path, last_sep - path + 1);
599 eina_strbuf_append(buf, "data/elementary");
600 app_data_dir = eina_strbuf_string_steal(buf);
601 eina_strbuf_free(buf);
602 /* yes this leaks app_data_dir but it's a one time allocation who cares */
603 }
604 else
605 app_data_dir = eina_prefix_data_get(app_pfx);
591 return app_data_dir; 606 return app_data_dir;
592} 607}
593 608