aboutsummaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/buffer.c b/buffer.c
index 5afc26a..e70cffe 100644
--- a/buffer.c
+++ b/buffer.c
@@ -47,6 +47,8 @@ newBuffer(int width)
#ifdef USE_M17N
n->auto_detect = WcOption.auto_detect;
#endif
+ n->check_url = MarkAllPages; /* use default from -o mark_all_pages */
+ n->need_reshape = 1; /* always reshape new buffers to mark URLs */
return n;
}
@@ -705,6 +707,7 @@ readBufferCache(Buffer *buf)
cache = fopen(buf->savecache, "r");
if (cache == NULL || fread1(clnum, cache) || fread1(tlnum, cache)) {
+ fclose(cache);
buf->savecache = NULL;
return -1;
}
@@ -760,8 +763,10 @@ readBufferCache(Buffer *buf)
}
#endif
}
- buf->lastLine = prevl;
- buf->lastLine->next = NULL;
+ if (prevl) {
+ buf->lastLine = prevl;
+ buf->lastLine->next = NULL;
+ }
fclose(cache);
unlink(buf->savecache);
buf->savecache = NULL;