On 03/31/2010 05:14 PM, David Cantrell wrote:
+ /*
+ * Because currently initrd.img only has got the default English locale
+ * support, pretend for newtInit() it is actually the used LANG so Newt
+ * knows how to compute character widths etc.
+ **/
+ char *lang = strdup(getenv("LANG"));
getenv() can return NULL here, in which case we don't want to strdup() the
result.
Thanks for that catch. Is this better?
char *lang = getenv("LANG");
if (lang) {
lang = strdup(lang);
}
setenv("LANG", LANG_DEFAULT, 1);
newtInit();
unsetenv("LANG");
/* restore the original LANG value */
if (lang) {
setenv("LANG", lang, 1);
free(lang);
}
Ales
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list