gnokii-users
[Top][All Lists]
Advanced

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

Re: Xgnokii problems


From: Pawel Kot
Subject: Re: Xgnokii problems
Date: Sun, 23 Jan 2005 23:02:52 +0100 (CET)

On Sun, 23 Jan 2005, Daniele Forsi wrote:

> Look at line 2362 of xgnokii.c in the CVS:
>       /* we have set en_US.UTF8 locale that is not supported by xgnokii */
>       if (!LocaleHelpExists(xgnokiiConfig.help_locale)) {
>               char *pos = strchr(xgnokiiConfig.locale, '.');
>               g_free(xgnokiiConfig.help_locale);
>
> here after line 2365 it should do something like
>               if (!pos) {
>                       xgnokiiConfig.help_locale = g_strdup("en_US");
>                       return;
>               }

Thanks for spotting. What about this:
--- xgnokii/xgnokii.c~  2005-01-23 22:50:40.000000000 +0100
+++ xgnokii/xgnokii.c   2005-01-23 22:50:40.000000000 +0100
@@ -2313,6 +2313,9 @@
        gchar *file;
        struct stat buf;

+       if (!help_locale)
+               return false;
+
        file = g_strdup_printf("/%s/help/%s", xgnokiiConfig.xgnokiidir, 
help_locale);
        if (stat(file, &buf) == 0)
                retval = true;
@@ -2363,8 +2366,9 @@
        if (!LocaleHelpExists(xgnokiiConfig.help_locale)) {
                char *pos = strchr(xgnokiiConfig.locale, '.');
                g_free(xgnokiiConfig.help_locale);
-               xgnokiiConfig.help_locale = g_strndup(xgnokiiConfig.locale,
-                                               pos - xgnokiiConfig.locale);
+               if (pos)
+                       xgnokiiConfig.help_locale = 
g_strndup(xgnokiiConfig.locale,
+                                                             pos - 
xgnokiiConfig.locale);
                if (!LocaleHelpExists(xgnokiiConfig.help_locale)) {
                        g_free(xgnokiiConfig.help_locale);
                        xgnokiiConfig.help_locale = g_strdup("en_US");

pkot
-- 
p k o t a t b e z s e n s u d o t p l
http://www.gnokii.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]