This function is supposed to treat NULL and "Auto" the same way, but it
tried to xstrdup NULL, which doesn't work.
This is easy to reproduce by attempting to use File|Import Data to read
a short file whose contents are all ASCII.
Bug #41971.
Reported by Mindaugus.
&& !strcmp (r->encoding, "ASCII"))
{
r->state = S_AUTO;
- r->auto_encoding = xstrdup (encoding);
+ r->auto_encoding = encoding ? xstrdup (encoding) : NULL;
}
else
r->state = r->encoding_info.unit == 1 ? S_UNIBYTE : S_MULTIBYTE;