Re: [f13-branch] loader: con Newt into thinking LANG is always en_US.UTF-8 (#576541).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux