Bug#170871: (no subject)
On Tue, Dec 03, 2002 at 11:34:13PM +0100, Alex de Landgraaf wrote:
> a patch for the recently uploaded xmms-nas package bug, hostname wasnt being saved.
> I guess QA wanted to use env settings to handle this?
QA had nothing to do with it; I didn't touch this part of the code when
I did the recent QA upload of xmms-nas, I just didn't notice that it was
there.
> added else to otherwise just use the string inserted :)
> --- xmms-nas-0.2/nasconf.c 2002-12-03 23:12:38.000000000 +0000
> +++ xmms-new/nasconf.c 2002-12-03 23:06:00.000000000 +0000
> @@ -43,6 +43,9 @@
>
> if (getenv("AUDIOHOST") && g_strcasecmp(nas_cfg.server,getenv("AUDIOHOST")))
> xmms_cfg_write_string(cfgfile, "NAS", "server", nas_cfg.server);
> + else if (g_strcasecmp(nas_cfg.server,"") != 0)
> + xmms_cfg_write_string(cfgfile, "NAS", "server", nas_cfg.server);
> +
> xmms_cfg_write_int(cfgfile, "NAS", "buffer_size", nas_cfg.bufsize);
> xmms_cfg_write_file(cfgfile, filename);
> xmms_cfg_free(cfgfile);
Thanks for the patch. Wouldn't it be better to say something more like:
if (g_strcasecmp(nas_cfg.server,
getenv("AUDIOHOST") ? getenv("AUDIOHOST") : ""))
(or a variant with less duplication)? That seems to be closer to the
intent of the original code, i.e. don't save nas_cfg.server if it's
equal to the value of $AUDIOHOST.
Cheers,
--
Colin Watson [cjwatson@flatline.org.uk]
Reply to: