billiob pushed a commit to branch master.

http://git.enlightenment.org/apps/terminology.git/commit/?id=822bd70afdb16f9354a4353ebcffba67f8ef5e31

commit 822bd70afdb16f9354a4353ebcffba67f8ef5e31
Author: Boris Faure <[email protected]>
Date:   Sun Sep 8 21:18:53 2019 +0200

    utils: avoid using functions too new (only in EFL >=1.21)
---
 src/bin/utils.c | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/bin/utils.c b/src/bin/utils.c
index fddb016..9232676 100644
--- a/src/bin/utils.c
+++ b/src/bin/utils.c
@@ -150,8 +150,7 @@ utils_need_scale_wizard(void)
    static char path[PATH_MAX] = "";
    struct stat st;
    int res;
-   char *tmp;
-   Eina_Bool use_xdg_config;
+   char *config_xdg = getenv("ELM_CONFIG_DIR_XDG");
 
 
    snprintf(path, sizeof(path) -1, "%s/terminology/config/",
@@ -160,14 +159,22 @@ utils_need_scale_wizard(void)
    if (res == 0)
      return EINA_FALSE;
 
-   use_xdg_config = (getenv("ELM_CONFIG_DIR_XDG") != NULL);
-
-   if (use_xdg_config)
-     tmp = eina_vpath_resolve("(:usr.config:)/elementary");
+   if (config_xdg)
+     {
+        snprintf(path, sizeof(path) - 1,
+                 "%s/elementary", config_xdg);
+     }
    else
-     tmp = eina_vpath_resolve("(:home:)/" ".elementary");
-   res = stat(tmp, &st);
-   free(tmp);
+     {
+        const char *suffix = "/.elementary";
+        char home[PATH_MAX - strlen(suffix)];
+
+        if (!homedir_get(home, sizeof(home)))
+            return EINA_TRUE;
+        snprintf(path, sizeof(path) - 1,
+                 "%s%s", home, suffix);
+     }
+   res = stat(path, &st);
    if (res == 0)
      return EINA_FALSE;
 

-- 


Reply via email to