From 8de592ab5a39c48381c1cd5d4b32f6f2b7e6864b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 4 Feb 2014 23:15:46 -0500 Subject: [PATCH] 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 --- lib/krb5/plugin.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/krb5/plugin.c b/lib/krb5/plugin.c index f69e9eb67..03f64000f 100644 --- a/lib/krb5/plugin.c +++ b/lib/krb5/plugin.c @@ -234,7 +234,7 @@ resolve_origin(const char *di) #ifndef HAVE_DLADDR return strdup(LIBDIR "/plugin/krb5"); -#else +#else /* !HAVE_DLADDR */ di += sizeof("$ORIGIN") - 1; if (dladdr(_krb5_load_plugins, &dl_info) == 0) @@ -245,8 +245,7 @@ resolve_origin(const char *di) p = strrchr(dname, '\\'); if (p == NULL) #endif - - p = strrchr(dname, '/'); + p = strrchr(dname, '/'); if (p) { if (asprintf(&path, "%.*s%s", (int) (p - dname), dname, di) == -1) return NULL; @@ -256,7 +255,7 @@ resolve_origin(const char *di) } return path; -#endif +#endif /* !HAVE_DLADDR */ }