summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAdrien Nader <adrien@notk.org>2014-08-09 12:09:44 +0200
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-14 20:55:58 +0900
commit37780369266db89e968bf646ca76aa7605f00c78 (patch)
tree58cba614a3b6fe0e33e4f9a58e3c3c566e75acab /src/lib
parent0fb9f5d5163fbeb5304684714f7e9aa41f1485a5 (diff)
efreet: reverse if's condition and swap then/else blocks for readability
The reversal makes it possible to merge two #if and unspaghetti the code a bit. Since the diff is not very readable, here is the before/after to show the spirit: before: #if cond if (...) #endif do_foo(); #if cond else do_bar(); #endif after: #if cond if ( ! ...) do_bar(); else #endif do_foo();
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efreet/efreet_base.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c
index dfc5a3aa9b..7a20a9c5a0 100644
--- a/src/lib/efreet/efreet_base.c
+++ b/src/lib/efreet/efreet_base.c
@@ -277,17 +277,16 @@ efreet_dirs_init(void)
277 277
278 /* efreet_home_dir */ 278 /* efreet_home_dir */
279#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) 279#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
280 if (getuid() == geteuid()) 280 if (getuid() != geteuid())
281#endif
282 efreet_home_dir = getenv("HOME");
283#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
284 else
285 { 281 {
286 struct passwd *pw = getpwent(); 282 struct passwd *pw = getpwent();
287 283
288 if ((pw) && (pw->pw_dir)) efreet_home_dir = pw->pw_dir; 284 if ((pw) && (pw->pw_dir)) efreet_home_dir = pw->pw_dir;
289 } 285 }
286 else
290#endif 287#endif
288 efreet_home_dir = getenv("HOME");
289
291#ifdef _WIN32 290#ifdef _WIN32
292 if (!efreet_home_dir || efreet_home_dir[0] == '\0') 291 if (!efreet_home_dir || efreet_home_dir[0] == '\0')
293 { 292 {