[geany/geany-plugins] 5d8854: spellcheck: Fix check for default language if LANG contains UTF-8

Colomban Wendling git-noreply at xxxxx
Thu Mar 28 14:50:06 UTC 2013


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Thu, 28 Mar 2013 14:50:06 UTC
Commit:      5d88549932587699b8719e27aed0bb6f936c8b5c
             https://github.com/geany/geany-plugins/commit/5d88549932587699b8719e27aed0bb6f936c8b5c

Log Message:
-----------
spellcheck: Fix check for default language if LANG contains UTF-8

g_strndup() copies bytes, not UTF-8 characters.


Modified Paths:
--------------
    spellcheck/src/speller.c

Modified: spellcheck/src/speller.c
2 files changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -267,7 +267,7 @@ gchar *sc_speller_get_default_lang(void)
 		{	/* if we have something like de_DE.UTF-8, strip everything from the period to the end */
 			gchar *period = strchr(lang, '.');
 			if (period != NULL)
-				result = g_strndup(lang, g_utf8_pointer_to_offset(lang, period));
+				result = g_strndup(lang, period - lang);
 		}
 	}
 	else



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list