diff options
author | portix <portix@gmx.net> | 2011-10-29 06:35:13 +0200 |
---|---|---|
committer | portix <portix@gmx.net> | 2011-10-29 06:35:13 +0200 |
commit | 32fa77faae43851d8d36cccb3dabd444a521bc21 (patch) | |
tree | 5953c206ca342918a3406b785e9f2c44a6741633 /src/util.c | |
parent | f3aa0db4ddc5331018c3ec8b508a191f03060840 (diff) | |
download | dwb-32fa77faae43851d8d36cccb3dabd444a521bc21.zip |
Fixing that no new bookmark/history file is created
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -590,7 +590,7 @@ util_file_add(const char *filename, const char *text, int append, int max) { g_string_append_printf(content, "%s\n", text); gboolean ret = true; - if ( (file = fopen(filename, "r")) ) { + if ( (file = fopen(filename, "r"))) { for (int i=0; fgets(buffer, sizeof buffer, file) && (max < 0 || i < max-1); i++ ) { if (STRCMP_FIRST_WORD(text, buffer) && STRCMP_SKIP_NEWLINE(text, buffer) ) { g_string_append(content, buffer); @@ -598,16 +598,10 @@ util_file_add(const char *filename, const char *text, int append, int max) { } fclose(file); } - else { - fprintf(stderr, "Cannot open file %s\n", filename); - ret = false; - goto error_out; - } if (append) g_string_append_printf(content, "%s\n", text); ret = util_set_file_content(filename, content->str); -error_out: g_string_free(content, true); return ret; } |