diff --git a/src/main.c b/src/main.c
index 5b31f41a410dcec78d3cb907e41264cd18addeb3..185ca5d97405a25a2950ff6ba0520c13dc1d4d0d 100644 (file)
--- a/src/main.c
+++ b/src/main.c
return settings_name(settings);
#else
(void)connection;
- 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
}