From: Jonathan Neuschäfer Date: Sat, 19 Nov 2011 23:52:15 +0000 (+0100) Subject: main: don't show "connecting to (null)" X-Git-Tag: release-0.20~50 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8b4b7f51ae2ef4dbd781df5c551e68382489d3be;p=ncmpc.git main: don't show "connecting to (null)" This patch is a follow-up to commit b774eac8d9 ("main: don't show (null) as the server name"). --- diff --git a/src/main.c b/src/main.c index 389b8c6..1e7caee 100644 --- a/src/main.c +++ b/src/main.c @@ -271,7 +271,12 @@ default_settings_name(void) return name; #else - return g_strdup(options.host); + /* + * localhost is actually not correct, we only know that + * mpd_connection_new() has connected to the "default host". + */ + const char *name = options.host ?: "localhost"; + return g_strdup(name); #endif } @@ -288,12 +293,7 @@ connection_settings_name(const struct mpd_connection *connection) #else (void)connection; - /* - * localhost is actually not correct, we only know that - * mpd_connection_new() has connected to the "default host". - */ - const char *name = options.host ?: "localhost"; - return g_strdup(name); + return default_settings_name(); #endif }