diff options
Diffstat (limited to '')
-rw-r--r-- | kbx/keybox-search.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c index 56515d16a..0bd4e0182 100644 --- a/kbx/keybox-search.c +++ b/kbx/keybox-search.c @@ -746,8 +746,13 @@ keybox_search_reset (KEYBOX_HANDLE hd) if (hd->fp) { - fclose (hd->fp); - hd->fp = NULL; + if (fseeko (hd->fp, 0, SEEK_SET)) + { + /* Ooops. Seek did not work. Close so that the search will + * open the file again. */ + fclose (hd->fp); + hd->fp = NULL; + } } hd->error = 0; hd->eof = 0; |