raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=cb255803af3d786ada16454c826120616431f057

commit cb255803af3d786ada16454c826120616431f057
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Fri Jul 24 23:57:29 2015 +0900

    elm config save - work around compiler bug that loses local var value
    
    yes. compiler bug. believe it or not.
---
 src/lib/elm_config.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 2e5b086..90fe31a 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -570,6 +570,13 @@ _elm_config_user_dir_snprintf(char       *dst,
                  ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
 #endif
           }
+        off = user_dir_len + 1;
+        if (off >= size) return off;
+        dst[user_dir_len] = '/';
+        va_start(ap, fmt);
+        off = off + vsnprintf(dst + off, size - off, fmt, ap);
+        va_end(ap);
+        return off;
      }
 #if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
    else
@@ -590,20 +597,16 @@ _elm_config_user_dir_snprintf(char       *dst,
            ELEMENTARY_BASE_DIR, sizeof(ELEMENTARY_BASE_DIR) - 1);
 #  endif
 # endif /* HAVE_GETPWENT */
+        off = user_dir_len + 1;
+        if (off >= size) return off;
+        dst[user_dir_len] = '/';
+        va_start(ap, fmt);
+        off = off + vsnprintf(dst + off, size - off, fmt, ap);
+        va_end(ap);
+        return off;
      }
 #endif
-
-   off = user_dir_len + 1;
-   if (off >= size) goto end;
-
-   va_start(ap, fmt);
-   dst[user_dir_len] = '/';
-
-   off = off + vsnprintf(dst + off, size - off, fmt, ap);
-   va_end(ap);
-
-end:
-   return off;
+   return 0;
 }
 
 const char *

-- 


Reply via email to