X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Firi.c;fp=src%2Firi.c;h=d23615ae7fb4942de22f8ac5a68ddff9f17d10d3;hp=c28d4f517367c36b84d5185e6edb3a8cd0eff1d8;hb=c31e00b52d49632dd0f005269ab2b820c7fd2c34;hpb=b30a0dd817886f77a64be9218c5e5399bcbc2e67 diff --git a/src/iri.c b/src/iri.c index c28d4f51..d23615ae 100644 --- a/src/iri.c +++ b/src/iri.c @@ -337,18 +337,27 @@ void set_current_charset (char *charset) { /*printf("[ current = `%s'\n", charset);*/ if (current) - xfree (current); + { + /* Do nothing if already equal */ + if (!strcasecmp (current, charset)) + return; + xfree (current); + } current = charset ? xstrdup (charset) : NULL; } void set_current_as_locale (void) { + /* sXXXav : assert opt.locale NULL ? */ /*printf("[ current = locale = `%s'\n", opt.locale);*/ if (current) - xfree (current); + { + if (!strcasecmp (current, opt.locale)) + return; + xfree (current); + } - /* sXXXav : assert opt.locale NULL ? */ current = xstrdup (opt.locale); } @@ -357,8 +366,12 @@ set_remote_charset (char *charset) { /*printf("[ remote = `%s'\n", charset);*/ if (remote) - xfree (remote); - + { + /* Do nothing if already equal */ + if (!strcasecmp (remote, charset)) + return; + xfree (remote); + } remote = charset ? xstrdup (charset) : NULL; } @@ -367,7 +380,12 @@ set_remote_as_current (void) { /*printf("[ remote = current = `%s'\n", current);*/ if (remote) - xfree (remote); + { + /* Do nothing if already equal */ + if (current && !strcasecmp (remote, current)) + return; + xfree (remote); + } remote = current ? xstrdup (current) : NULL; }