forgot to commit this fix from upstream for segfault on initialization

reminded by Bernd Ahlers
This commit is contained in:
david 2005-05-01 17:25:26 +00:00
parent e2a4649fd3
commit 57126f0305

View File

@ -0,0 +1,36 @@
$OpenBSD: patch-src_i18n_c,v 1.3 2005/05/01 17:25:26 david Exp $
--- src/i18n.c.orig Wed Apr 27 14:57:14 2005
+++ src/i18n.c Sun May 1 12:18:07 2005
@@ -26,7 +26,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
- * $Id: patch-src_i18n_c,v 1.3 2005/05/01 17:25:26 david Exp $
+ * $Id: patch-src_i18n_c,v 1.3 2005/05/01 17:25:26 david Exp $
*/
#include "micq.h"
@@ -110,12 +110,12 @@ void i18nInit (const char *arg)
earg = getenv ("LC_MESSAGES");
if (!earg)
earg = getenv ("LANG");
+ if (!earg)
+ earg = "C";
if (earg && !prG->locale_orig)
s_repl (&prG->locale_orig, earg);
if (earg && !prG->locale_full)
s_repl (&prG->locale_full, earg);
- if (!earg)
- earg = "C";
if (strchr (earg, '.') && arg && !strchr (arg, '.'))
{
arg = earg;
@@ -155,7 +155,7 @@ int i18nOpen (const char *ploc)
loc = ploc ? ploc : prG->locale_full;
- if (!strcmp (loc, "en_US.US-ASCII") || !strcmp (loc, "C") || !strcmp (loc, "C"))
+ if (!loc || !strcmp (loc, "en_US.US-ASCII") || !strcmp (loc, "C"))
{
i18nClose ();
if (ploc)