run: Support PulseAudio socket path without unix: prefix

https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/ServerStrings/
says:

> If the string starts with / or unix: the remaining address string is taken as
> UNIX socket name.

but previously the string was only taken to be a UNIX socket name if it began
with "unix:".

This is an issue in practice with WSLg <https://github.com/microsoft/wslg>
which sets $PULSE_SERVER to "/mnt/wslg/PulseServer", without a "unix:" prefix.
This commit is contained in:
Will Thompson
2021-11-11 15:48:04 +00:00
committed by Simon McVittie
parent 692ec8644e
commit 7534a970a5

View File

@@ -591,8 +591,11 @@ flatpak_run_parse_pulse_server (const char *value)
continue;
server = closing + 1;
}
if (g_str_has_prefix (server, "unix:"))
return g_strdup (server + 5);
if (server[0] == '/')
return g_strdup (server);
}
return NULL;