X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/3f935d5bf975b26836da2fac5cd6e3df67a5e184..1957695ce47dd93c30efc48ca1f272a34c732841:/unix/uxstore.c diff --git a/unix/uxstore.c b/unix/uxstore.c index b04d557c..54d35fc9 100644 --- a/unix/uxstore.c +++ b/unix/uxstore.c @@ -29,7 +29,7 @@ static char *mungestr(const char *in) { char *out, *ret; - if (!in) + if (!in || !*in) in = "Default Settings"; ret = out = snewn(3*strlen(in)+1, char); @@ -127,13 +127,6 @@ static char *fgetline(FILE *fp) return ret; } -/* - * For the moment, the only existing Unix utility is pterm and that - * has no GUI configuration at all, so our write routines need do - * nothing. Eventually I suppose these will read and write an rc - * file somewhere or other. - */ - void *open_settings_w(const char *sessionname, char **errmsg) { char filename[FILENAME_MAX]; @@ -188,6 +181,7 @@ void close_settings_w(void *handle) * PuTTY's inbuilt defaults, but that the disk files will then * override those. This isn't optimal, but it's the best I can * immediately work out. + * FIXME: the above comment is a bit out of date. Did it happen? */ struct keyval { @@ -494,6 +488,7 @@ int verify_host_key(const char *hostname, int port, break; } + fclose(fp); return ret; }