mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
core-util: implement pa_maybe_prefix_path()
This commit is contained in:
parent
7fa05bea7e
commit
0fa1ddf838
2 changed files with 11 additions and 0 deletions
|
|
@ -2768,3 +2768,12 @@ char **pa_split_spaces_strv(const char *s) {
|
|||
t[i] = NULL;
|
||||
return t;
|
||||
}
|
||||
|
||||
char* pa_maybe_prefix_path(const char *path, const char *prefix) {
|
||||
pa_assert(path);
|
||||
|
||||
if (pa_is_path_absolute(path))
|
||||
return pa_xstrdup(path);
|
||||
|
||||
return pa_sprintf_malloc("%s" PA_PATH_SEP "%s", prefix, path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,4 +237,6 @@ static inline void pa_xstrfreev(char **a) {
|
|||
|
||||
char **pa_split_spaces_strv(const char *s);
|
||||
|
||||
char* pa_maybe_prefix_path(const char *path, const char *prefix);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue