[Commits] [SCM] claws branch, master, updated. 3.17.0-29-g48ba0be
wwp at claws-mail.org
wwp at claws-mail.org
Thu Aug 30 08:31:18 CEST 2018
The branch, master has been updated
via 48ba0be464519da10458f55d0587a6a67c630556 (commit)
from 1006bf39d36861d210e18bce5c4a5b9a174b1724 (commit)
Summary of changes:
src/common/prefs.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
- Log -----------------------------------------------------------------
commit 48ba0be464519da10458f55d0587a6a67c630556
Author: wwp <subscript at free.fr>
Date: Thu Aug 30 08:29:30 2018 +0200
Fix wrong logics leading to writing possibly broken config file,
patch by Olivier Brunel.
diff --git a/src/common/prefs.c b/src/common/prefs.c
index d621a7a..23bcc22 100644
--- a/src/common/prefs.c
+++ b/src/common/prefs.c
@@ -278,7 +278,7 @@ gint prefs_set_block_label(PrefFile *pfile, const gchar *label)
{
gchar *block_label;
gchar buf[BUFFSIZE];
-
+
block_label = g_strdup_printf("[%s]", label);
if (!pfile->writing) {
while (fgets(buf, sizeof(buf), pfile->fp) != NULL) {
@@ -296,7 +296,7 @@ gint prefs_set_block_label(PrefFile *pfile, const gchar *label)
while (fgets(buf, sizeof(buf), pfile->orig_fp) != NULL) {
gint val;
-
+
val = strncmp(buf, block_label, strlen(block_label));
if (val == 0) {
debug_print("Found %s\n", block_label);
@@ -312,20 +312,20 @@ gint prefs_set_block_label(PrefFile *pfile, const gchar *label)
}
}
}
-
+
if (!block_matched) {
fclose(pfile->orig_fp);
pfile->orig_fp = NULL;
}
-
- if (fputs(block_label, pfile->fp) == EOF ||
- fputc('\n', pfile->fp) == EOF) {
- g_warning("failed to write configuration to file");
- prefs_file_close_revert(pfile);
- g_free(block_label);
-
- return -1;
- }
+ }
+
+ if (fputs(block_label, pfile->fp) == EOF ||
+ fputc('\n', pfile->fp) == EOF) {
+ g_warning("failed to write configuration to file");
+ prefs_file_close_revert(pfile);
+ g_free(block_label);
+
+ return -1;
}
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list