mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-08 13:29:59 -05:00
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).
This commit is contained in:
parent
4e8562c1f1
commit
ae383539d7
1 changed files with 6 additions and 6 deletions
|
|
@ -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) {
|
static char *get_path(const char *fn, pa_bool_t prependmid, pa_bool_t rt) {
|
||||||
char *rtp;
|
char *rtp;
|
||||||
|
|
||||||
if (pa_is_path_absolute(fn))
|
|
||||||
return pa_xstrdup(fn);
|
|
||||||
|
|
||||||
rtp = rt ? pa_get_runtime_dir() : pa_get_state_dir();
|
rtp = rt ? pa_get_runtime_dir() : pa_get_state_dir();
|
||||||
|
|
||||||
if (!rtp)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
if (fn) {
|
if (fn) {
|
||||||
char *r;
|
char *r;
|
||||||
|
|
||||||
|
if (pa_is_path_absolute(fn))
|
||||||
|
return pa_xstrdup(fn);
|
||||||
|
|
||||||
|
if (!rtp)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (prependmid) {
|
if (prependmid) {
|
||||||
char *mid;
|
char *mid;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue