summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-10-29 06:35:13 +0200
committerportix <portix@gmx.net>2011-10-29 06:35:13 +0200
commit32fa77faae43851d8d36cccb3dabd444a521bc21 (patch)
tree5953c206ca342918a3406b785e9f2c44a6741633 /src/util.c
parentf3aa0db4ddc5331018c3ec8b508a191f03060840 (diff)
downloaddwb-32fa77faae43851d8d36cccb3dabd444a521bc21.zip
Fixing that no new bookmark/history file is created
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/util.c b/src/util.c
index 91385b87..adaa1ec7 100644
--- a/src/util.c
+++ b/src/util.c
@@ -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;
}