improve resolve_origin readability

comment the HAVE_DLADDR preprocessor #else and #endif
because they are so many lines apart.

indent the strrchr() call after the _Win32 block to demonstrate
they are related.

Change-Id: I112dc91b350b277cdb1dc1cd3ccd8f31a2084409
This commit is contained in:
Jeffrey Altman
2014-02-04 23:15:46 -05:00
parent d9bc256199
commit 8de592ab5a

View File

@@ -234,7 +234,7 @@ resolve_origin(const char *di)
#ifndef HAVE_DLADDR #ifndef HAVE_DLADDR
return strdup(LIBDIR "/plugin/krb5"); return strdup(LIBDIR "/plugin/krb5");
#else #else /* !HAVE_DLADDR */
di += sizeof("$ORIGIN") - 1; di += sizeof("$ORIGIN") - 1;
if (dladdr(_krb5_load_plugins, &dl_info) == 0) if (dladdr(_krb5_load_plugins, &dl_info) == 0)
@@ -245,7 +245,6 @@ resolve_origin(const char *di)
p = strrchr(dname, '\\'); p = strrchr(dname, '\\');
if (p == NULL) if (p == NULL)
#endif #endif
p = strrchr(dname, '/'); p = strrchr(dname, '/');
if (p) { if (p) {
if (asprintf(&path, "%.*s%s", (int) (p - dname), dname, di) == -1) if (asprintf(&path, "%.*s%s", (int) (p - dname), dname, di) == -1)
@@ -256,7 +255,7 @@ resolve_origin(const char *di)
} }
return path; return path;
#endif #endif /* !HAVE_DLADDR */
} }