Code

main: don't show "connecting to (null)"
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Sat, 19 Nov 2011 23:52:15 +0000 (00:52 +0100)
committerMax Kellermann <max@duempel.org>
Fri, 2 Dec 2011 11:08:34 +0000 (12:08 +0100)
This patch is a follow-up to commit b774eac8d9 ("main: don't show
(null) as the server name").

src/main.c

index 389b8c68e570f2c8eb52a22e0419a81cfa62f35d..1e7caeea8444a346c003466851c80ab3f254c5fa 100644 (file)
@@ -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
 }