okra pushed a commit to branch master.

http://git.enlightenment.org/apps/ephoto.git/commit/?id=b05d3b1dbae9a3fb587ebbaef3e6c1eefa4415e9

commit b05d3b1dbae9a3fb587ebbaef3e6c1eefa4415e9
Author: Stephen okra Houston <[email protected]>
Date:   Mon Aug 29 14:08:02 2016 -0500

    Ephoto: Better checking for XDG_CONFIG_HOME.
---
 src/bin/ephoto_config.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/bin/ephoto_config.c b/src/bin/ephoto_config.c
index 35a7da3..fd833d3 100644
--- a/src/bin/ephoto_config.c
+++ b/src/bin/ephoto_config.c
@@ -623,9 +623,11 @@ _ephoto_config_load(Ephoto *ephoto)
    Eet_File *ef;
    char buf[4096], buf2[4096], xdg[4096];
 
-   snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
-   if (strlen(xdg))
-     snprintf(buf2, sizeof(buf2), "%s/ephoto", xdg);
+   if (getenv("XDG_CONFIG_HOME"))
+     {
+        snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
+        snprintf(buf2, sizeof(buf2), "%s/ephoto", xdg);
+     }
    else
      snprintf(buf2, sizeof(buf2), "%s/.config/ephoto", getenv("HOME"));
    ecore_file_mkpath(buf2);
@@ -666,9 +668,11 @@ _ephoto_on_config_save(void *data)
    Eet_File *ef;
    char buf[4096], buf2[4096], xdg[4096];
 
-   snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
-   if (strlen(xdg))
-     snprintf(buf, sizeof(buf), "%s/ephoto/ephoto.cfg", xdg);
+   if (getenv("XDG_CONFIG_HOME"))
+     {
+        snprintf(xdg, PATH_MAX, "%s", getenv("XDG_CONFIG_HOME"));
+        snprintf(buf, sizeof(buf), "%s/ephoto/ephoto.cfg", xdg);
+     }
    else
      snprintf(buf, sizeof(buf), "%s/.config/ephoto/ephoto.cfg", 
getenv("HOME"));
    snprintf(buf2, sizeof(buf2), "%s.tmp", buf);

-- 


Reply via email to