+ if (name[0] == PA_PATH_SEP_CHAR) {
+ result = access(name, F_OK) == 0 ? true : false;
+ pa_log_debug("Checking for existence of '%s': %s", name, result ? "success" : "failure");
+ if (result)
+ return true;
+ }
+
+ if (!(paths = lt_dlgetsearchpath()))
+ return false;
+
+ /* strip .so from the end of name, if present */
+ n = pa_xstrdup(name);
+ p = strrchr(n, '.');
+ if (p && pa_streq(p, PA_SOEXT))
+ p[0] = 0;
+
+ while ((p = pa_split(paths, ":", &state))) {
+ pathname = pa_sprintf_malloc("%s" PA_PATH_SEP "%s" PA_SOEXT, p, n);
+ result = access(pathname, F_OK) == 0 ? true : false;
+ pa_log_debug("Checking for existence of '%s': %s", pathname, result ? "success" : "failure");
+ pa_xfree(pathname);
+ pa_xfree(p);
+ if (result) {
+ pa_xfree(n);
+ return true;
+ }
+ }