aboutsummaryrefslogtreecommitdiff
path: root/src/gdbmdump.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-08-12 20:17:14 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-08-12 20:17:14 +0300
commit4e23fa7b90b56408d480ba8c7556b190757ea2c7 (patch)
tree7763d0dee3681c0a733a490feaf6dbdcf54e3f8d /src/gdbmdump.c
parent6311c6b4d7ebe989447151a3e0f8b8ae0b5997d3 (diff)
downloadgdbm-4e23fa7b90b56408d480ba8c7556b190757ea2c7.tar.gz
gdbm-4e23fa7b90b56408d480ba8c7556b190757ea2c7.tar.bz2
Bugfix
* src/gdbmdump.c (_gdbm_dump_ascii): Clear the GDBM_ITEM_NOT_FOUND error. * src/gdbmexp.c (gdbm_export_to_file): Likewise. * NEWS: Update.
Diffstat (limited to 'src/gdbmdump.c')
-rw-r--r--src/gdbmdump.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gdbmdump.c b/src/gdbmdump.c
index daf6a43..2e6f5b0 100644
--- a/src/gdbmdump.c
+++ b/src/gdbmdump.c
@@ -112,17 +112,23 @@ _gdbm_dump_ascii (GDBM_FILE dbf, FILE *fp)
count++;
}
- if (rc == 0 && (rc = gdbm_last_errno (dbf)) == 0)
+ /* FIXME: Something like that won't hurt, although load does not
+ use it currently. */
+ fprintf (fp, "#:count=%lu\n", (unsigned long) count);
+ fprintf (fp, "# End of data\n");
+
+ if (rc == 0)
{
-
- /* FIXME: Something like that won't hurt, although load does not
- use it currently. */
- fprintf (fp, "#:count=%lu\n", (unsigned long) count);
- fprintf (fp, "# End of data\n");
+ rc = gdbm_last_errno (dbf);
+ if (rc == GDBM_ITEM_NOT_FOUND)
+ {
+ gdbm_clear_error (dbf);
+ gdbm_errno = GDBM_NO_ERROR;
+ rc = 0;
+ }
}
free (buffer);
-
return rc ? -1 : 0;
}

Return to:

Send suggestions and report system problems to the System administrator.