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();
This commit is contained in:
Adrien Nader 2014-08-09 12:09:44 +02:00 committed by Carsten Haitzler (Rasterman)
parent 0fb9f5d516
commit 3778036926
1 changed files with 4 additions and 5 deletions

View File

@ -277,17 +277,16 @@ efreet_dirs_init(void)
/* efreet_home_dir */
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
if (getuid() == geteuid())
#endif
efreet_home_dir = getenv("HOME");
#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
else
if (getuid() != geteuid())
{
struct passwd *pw = getpwent();
if ((pw) && (pw->pw_dir)) efreet_home_dir = pw->pw_dir;
}
else
#endif
efreet_home_dir = getenv("HOME");
#ifdef _WIN32
if (!efreet_home_dir || efreet_home_dir[0] == '\0')
{