diff options
author | portix <none@none> | 2012-06-13 12:35:47 +0200 |
---|---|---|
committer | portix <none@none> | 2012-06-13 12:35:47 +0200 |
commit | a0835c12ddf1a13f695da7782b100c32f196c44f (patch) | |
tree | 9e4a9d558b13780ee121d7f216371322d604b134 /src | |
parent | d3c161a23aefc4631a7ccb4edb9871cdf961ada8 (diff) | |
download | dwb-a0835c12ddf1a13f695da7782b100c32f196c44f.zip |
Also strip history in dwb_sync_files
Diffstat (limited to 'src')
-rw-r--r-- | src/dwb.c | 3 | ||||
-rw-r--r-- | src/util.c | 2 |
2 files changed, 3 insertions, 2 deletions
@@ -1018,7 +1018,8 @@ dwb_remove_quickmark(const char *line) { static gboolean dwb_sync_files(gpointer data) { GString *buffer = g_string_new(NULL); - for (GList *gl = dwb.fc.history; gl; gl=gl->next) { + int i=0; + for (GList *gl = dwb.fc.history; gl && (dwb.misc.history_length < 0 || i < dwb.misc.history_length); gl=gl->next, i++) { Navigation *n = gl->data; g_string_append_printf(buffer, "%s %s\n", n->first, n->second); } @@ -647,7 +647,7 @@ util_file_add(const char *filename, const char *text, int append, int max) { gboolean ret = false; if ( (file = fopen(filename, "r"))) { - for (int i=0; fgets(buffer, sizeof buffer, file) && (max < 0 || i < max-1); i++ ) { + for (int i=0; fgets(buffer, sizeof buffer, file) && (max < 0 || i < max); i++) { tmp = buffer; while (g_ascii_isspace(*tmp) && *tmp != '\n') tmp++; |