diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2009-08-28 15:16:53 +0300 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-28 17:12:26 +0200 |
commit | ae383539d7001d59044e6d7e06e9270b65ae762b (patch) | |
tree | 36cb8a172b46460251da268dc577eaaab5540c15 /src | |
parent | 4e8562c1f1cf5ee134043747feea093ded469be4 (diff) |
core-util: Fix logic of pa_make_path_absolute()
Make it works as described in commentary (when fn is NULL, pa_assert(fn) could
break logic).
Diffstat (limited to 'src')
-rw-r--r-- | src/pulsecore/core-util.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 1c8c6780..67823019 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -1877,17 +1877,17 @@ char *pa_make_path_absolute(const char *p) { static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) { char *rtp; - if (pa_is_path_absolute(fn)) - return pa_xstrdup(fn); - rtp = rt ? pa_get_runtime_dir() : pa_get_state_dir(); - if (!rtp) - return NULL; - if (fn) { char *r; + if (pa_is_path_absolute(fn)) + return pa_xstrdup(fn); + + if (!rtp) + return NULL; + if (prependmid) { char *mid; |