[Commits] [SCM] claws branch, master, updated. 4.3.1-38-g295a5b31f

mones at claws-mail.org mones at claws-mail.org
Sun Mar 9 17:10:16 UTC 2025


The branch, master has been updated
       via  295a5b31fc8a52fe36bc7fdbf9cd554539bce8f5 (commit)
      from  9625310e58efa172e7147eb2de12319220876c2f (commit)

Summary of changes:
 src/prefs_spelling.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 295a5b31fc8a52fe36bc7fdbf9cd554539bce8f5
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Mar 9 18:09:47 2025 +0100

    Fix CID 1642812 "resource leak" and other issues
    
    • Compare refs_common.dictionary with the token actually added in
      create_empty_dictionary_list() function from gtkaspell.c
    
    • Simplify initial if/else
    
    • Improve readability of code

diff --git a/src/prefs_spelling.c b/src/prefs_spelling.c
index 3fee1cef0..7ced7f356 100644
--- a/src/prefs_spelling.c
+++ b/src/prefs_spelling.c
@@ -320,18 +320,17 @@ void prefs_spelling_init(void)
 	prefs_spelling = page;
 	
 	language = g_getenv("LANG");
-	if (language == NULL)
-		language = "en";
-	else if (!strcmp(language, "POSIX") || !strcmp(language, "C"))
+	if (language == NULL || !strcmp(language, "POSIX") || !strcmp(language, "C"))
 		language = "en";
 	
 	if (!prefs_common.dictionary)
-		prefs_common.dictionary = g_strdup_printf("%s",
-						language);
-	if (!strlen(prefs_common.dictionary)
-	||  !strcmp(prefs_common.dictionary,"(None"))
-		prefs_common.dictionary = g_strdup_printf("%s",
-						language);
+		prefs_common.dictionary = g_strdup_printf("%s", language);
+
+	if (!strlen(prefs_common.dictionary) || !strcmp(prefs_common.dictionary, _("None"))) {
+		g_free(prefs_common.dictionary);
+		prefs_common.dictionary = g_strdup_printf("%s", language);
+	}
+
 	if (strcasestr(prefs_common.dictionary,".utf"))
 		*(strcasestr(prefs_common.dictionary,".utf")) = '\0';
 	if (strstr(prefs_common.dictionary,"@"))

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list