ecore_con: be more defensive while using environment variable provided by the system.
authorCedric BAIL <cedric@osg.samsung.com>
Mon, 12 Oct 2015 21:00:01 +0000 (14:00 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Mon, 12 Oct 2015 21:01:23 +0000 (14:01 -0700)
This fix a crash during make check for system where one of those string where not defined.

src/tests/ecore_con/ecore_con_test_ecore_con.c

index 67f3672..6618221 100644 (file)
@@ -362,9 +362,9 @@ START_TEST(ecore_test_ecore_con_local_user_none)
    unsetenv("HOME");
    unsetenv("TMPDIR");
    _ecore_con_server_client_tests(ECORE_CON_LOCAL_USER, "test_sock", EINA_FALSE, 12345);
-   setenv("TMPDIR", tmp, 1);
-   setenv("HOME", homedir, 1);
-   setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
+   if (tmp) setenv("TMPDIR", tmp, 1);
+   if (homedir) setenv("HOME", homedir, 1);
+   if (xdg_runtime_dir) setenv("XDG_RUNTIME_DIR", xdg_runtime_dir, 1);
 }
 END_TEST