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]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 31 Mar 2010, Ales Kozumplik wrote:

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);
       }


Looks better.  Ack.

- -- David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkuzeK0ACgkQ5hsjjIy1Vkl2ZgCgtHdjxW+iEGSSPukvogw49T7r
f8IAnicGBsNiyUawz4oAyAEcUBXfVNZZ
=H3R0
-----END PGP SIGNATURE-----

_______________________________________________
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