X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fscreen_queue.c;h=47eb7165eee0404db24505cf1b659124f7c012e6;hb=23041f39c7c7e1d119ffe2f6239cc3a2f1248e1a;hp=d98445ded49bc0a1a6b3f8e2406e191dcd69dc27;hpb=8cfa274ebb484909dc7cf275338b6ab5580e7261;p=ncmpc.git diff --git a/src/screen_queue.c b/src/screen_queue.c index d98445d..47eb716 100644 --- a/src/screen_queue.c +++ b/src/screen_queue.c @@ -370,13 +370,28 @@ screen_queue_exit(void) list_window_free(lw); } +/** + * Extract the host portion (without the optional password) from the + * MPD_HOST string. + */ +static const char * +host_without_password(const char *host) +{ + const char *separator = strchr(host, '@'); + if (separator != NULL && separator != host && separator[1] != 0) + host = separator + 1; + + return host; +} + static const char * screen_queue_title(char *str, size_t size) { if (options.host == NULL) return _("Queue"); - g_snprintf(str, size, _("Queue on %s"), options.host); + g_snprintf(str, size, _("Queue on %s"), + host_without_password(options.host)); return str; }