| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* compat/dbmopen.c (ndbm_open_dir_file0): Don't try to unlink
the 1.8-compatible dir file or create a missing one if the database
is being opened read-only.
|
| |
|
| |
|
|
|
|
|
|
| |
* tools/gdbm_load.c (main): Restore accidentally removed parameter.
* tools/gdbmapp.h (GDBM_PRINTFLIKE): New macro
(gdbm_perror, sys_perror, error): Mark as printf-like.
|
| |
|
|
|
|
|
|
| |
* tools/gdbm_load.c (main): Imply the owner login group if owner name
is followed by a :, and the current login group otherwise.
* doc/gdbm.texi: Document changes.
|
|
|
|
|
|
|
|
|
|
| |
Fixes https://puszcza.gnu.org.ua/bugs/index.php?573
* tools/gdbm_load.c: New option: --update (-U)
The --replace (-r) option is valid only if used together with
--update.
* NEWS: Document changes.
* doc/gdbm.texi: Document changes.
|
|
|
|
|
| |
* tools/gdbmshell.c (input_history_begin): return GDBMSHELL_ERR
if history is not available.
|
|
|
|
| |
This fixes https://puszcza.gnu.org.ua/bugs/?567
|
| |
|
|
|
|
| |
* doc/gdbm.texi (Errors): Update @itemize list.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In particular, this addresses https://puszcza.gnu.org.ua/bugs/?566
* configure.ac: Fix diagnostic message
* tools/gdbmshell.c: Use lerror when needed.
(recover_handler): Accept varargs
(command_tab): Use argdoc to provide help for varargs
(help_handler): Handle argdoc
* tools/gdbmtool.h (PARAM_LOCPTR): New macro.
* tools/gram.y: Accept a single unadorned key=value pair as argument.
Fix locus for key=value pair in a list.
* tools/lex.l (YY_USER_ACTION): Use setbeg() to decide whether yyloc.beg
must be updated.
(setbeg): New function.
|
|
|
|
|
|
|
|
|
| |
Fixes https://puszcza.gnu.org.ua/bugs/?565
* src/gdbmexp.c (gdbm_export_to_file): Check for positive size before
attempting to write.
* src/gdbmimp.c (gdbm_import_from_file): Check for positive size before
attempting to read.
|
|
|
|
|
|
|
| |
* tools/parseopt.c (parseopt_next): Don't call parseopt_free. This
triggered coredumps if, e.g. parseopt_print_help() got called after
parsing the arguments. The bug was introduced by 203601fb06 in an
attempt to pacify valgrind an similar tools.
|
|
|
|
|
|
| |
* src/gdbmdefs.h: Minor change.
* src/lock.c: Clean up the code. Use F_TLOCK for lockf(), to avoid
blocking.
|
|
|
|
|
|
| |
* configure.ac: Check if getline is available.
* tools/gdbmshell.c (argsprep): Use getline.
[!HAVE_GETLINE] (getline): Simple replacement.
|
|
|
|
| |
* tools/datconv.c (f_string): Fix printing bytes in octal.
|
| |
|
|
|
|
|
| |
* src/bucket.c (_gdbm_split_bucket): When splitting the bucket, check
if hash values are within allowed range.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* tools/parseopt.c (print_option): Add newlines around group header
text.
Insert a comma between the short and corresponding long option.
(parseopt_print_help): Don't use parseopt_program_args if it's NULL
or empty.
* tools/wordwrap.c (wordwrap_set_left_margin): Always force reindent
of the following line.
(flush_line): Fix the "full write" condition.
|
|
|
|
|
|
| |
* src/bucket.c (_gdbm_cache_init): Accept sizes greater than the
directory size.
* src/gdbmsetopt.c (setopt_gdbm_getdbformat): Return 0 on success.
|
|
|
|
|
| |
* src/bucket.c (lru_unlink_elem): Take into account the possibility
that dbf->cache_mru can be NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of _gdbm_cache_flush becomes prohibitively
inefficient during extensive updates of large databases. The
bug was reported at https://github.com/Perl/perl5/issues/19306.
To fix it, make sure that all changed cache entries are placed at
the head of the cache_mru list, forming a contiguous sequence.
This way a potentially long iteration over all cache entries can be
cut off at the first entry with ca_changed == FALSE.
This commit also gets rid of several superfluous fields in
struct gdbm_file_info:
- cache_entry
Not needed, because the most recently used cache entry
(cache_mru) is always the current one.
- bucket_changed
dbf->cache_mru->ca_changed reflects the status of the current
bucket.
- second_changed
Not needed because _gdbm_cache_flush, which flushes all changed
buckets, is now invoked unconditionally by _gdbm_end_update (and
also whenever dbf->cache_mru changes).
* src/gdbmdefs.h (struct gdbm_file_info): Remove cache_entry. The
current cache entry is cache_mru.
Remove bucket_changed, and second_changed.
All uses changed.
* src/proto.h (_gdbm_current_bucket_changed): New inline function.
* src/bucket.c (_gdbm_cache_flush): Assume all changed elements form
a contiguous sequence beginning with dbf->cache_mru.
(set_cache_entry): Remove. All callers changed.
(lru_link_elem,lru_unlink_elem): Update dbf->bucket as necessary.
(cache_lookup): If the obtained bucket is not changed and is going
to become current, flush all changed cache elements.
* src/update.c (_gdbm_end_update): Call _gdbm_cache_flush unconditionally.
* src/findkey.c: Use dbf->cache_mru instead of the removed dbf->cache_entry.
* src/gdbmseq.c: Likewise.
* tools/gdbmshell.c (_gdbm_print_bucket_cache): Likewise.
* src/falloc.c: Use _gdbm_current_bucket_changed to mark the current
bucket as changed.
* src/gdbmstore.c: Likewise.
* src/gdbmdelete.c: Likewise. Use _gdbm_current_bucket_changed.
* tests/gtcacheopt.c: Fix typo.
* tests/gtload.c: New option: -cachesize
|
| |
|
|
|
|
|
|
| |
Sources for the libgdbm library reside in src/.
Sources for building accompanying tools are moved to the tools/
subdirectory.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Trailing whitespace was erroneously recognized as argument.
* src/lex.l (string_end): Optionally return NULL if the collected
string is of zero length.
When leaving the SHELL condition, don't return T_WORD for trailing
whitespace.
* src/gdbmshell.c (shell_handler): Perror after failed execv.
|
|
|
|
|
|
| |
* src/gdbmshell.c (import_handler): Fix option addressing (see
https://puszcza.gnu.org.ua/bugs/?535).
Fix freeing of the uninitialized variable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (libgdbmapp_a_SOURCES): Add wordwrap.c
* src/wordwrap.c: New file.
* tests/Makefile.am: Add t_wordwrap and wordspit.at
* tests/testsuite.at: Add new test.
* tests/t_wordwrap.c: New file.
* src/gdbmshell.c (help_handler): Use wordwrap functions.
* src/parseopt.c: Rewrite help output using wordwrap.
Add support for the ARGP_HELP_FMT environment variable.
Make sure no empty strings are ever passed to gettext.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Don't use $YACC and $LEX (undefined since f4c143fbdf).
* src/gdbmshell.c (run_command): Free arglist if not saved to last_args.
* src/gdbmtool.c (gdbmtool_init): Correctly report unrecognized long
options.
* src/gdbmtool.h (YY_LOCATION_PRINT): Define to locus_print.
(locus_print): New proto.
* src/gram.y: Define destructors for various symbols.
* src/lex.l: Save source file names in a linked list. Don't free
source name in input_context_pop, because yypush might refer to it
via yyloc stack even after readinf eof (e.g. when printing location).
The collected list is freed at program exit.
(locus_print): New function.
* src/parseopt.c (parseopt_free): New function.
(parseopt_first): Call parseopt_free.
(parseopt_next): Call parseopt_free, depending on the result.
* src/var.c (variable) <freehook>: New member.
(errormask_freehook): New function. Set it as freehook for errorexit
and errormask.
(variables_free): Call freehook, if defined.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Output from the "dir" command includes, for each directory entry, the
corresponding hash prefix.
The "bucket" command, when used without arguments, assumes current
bucket.
Its output includes: bucket local depth, number of directory entries
pointing to that bucket (references), and, if the latter is greater than
one, indexes to the first and last directory entries where it is referenced.
New command "sibling" inspects the sibling bucket of the current one, i.e.
the bucket corresponding to the hash prefix with the last bit inverted.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/cachetree.c: Remove.
* src/Makefile.am: Remove cachetree.c
* doc/gdbm.texi: Document the changes.
* src/bucket.c (cache_tab_lookup_slot)
(cache_tab_resize): New function.
(cache_elem_new): Initialize ca_coll.
(cache_elem_free, cache_lookup)
(_gdbm_cache_init,_gdbm_cache_free): Rewrite with hash-based cache lookup.
(_gdbm_fetch_data): Remove unused function.
* src/gdbm.h.in (GDBM_GETDBFORMAT, GDBM_GETDIRDEPTH)
(GDBM_GETBUCKETSIZE, GDBM_GETCACHEAUTO, GDBM_SETCACHEAUTO): New option codes.
* src/gdbmdefs.h (cache_node): Remove.
(cache_elem): Remove ca_node. Add ca_coll (collision resolution pointer).
(gdbm_file_info): New members: cache_auto, cache_bits, cache.
* src/gdbmopen.c (gdbm_fd_open): Change cache initialization.
* src/gdbmsetopt.c (GDBM_GETDBFORMAT,GDBM_GETDIRDEPTH)
(GDBM_GETBUCKETSIZE,GDBM_GETCACHEAUTO)
(GDBM_SETCACHEAUTO): Implement new options.
(setopt_gdbm_getflags): Reflect the state of GDBM_CLOEXEC and GDBM_NUMSYNC.
* src/proto.h (_gdbm_fetch_data,_gdbm_cache_tree_alloc)
(_gdbm_cache_tree_destroy,_gdbm_cache_tree_delete)
(_gdbm_cache_tree_lookup): Remove protos.
* src/recover.c (_gdbm_finish_transfer): Restore original cache settings.
* tests/Makefile.am: Add new test.
* tests/testsuite.at: Likewise.
* tests/gtcacheopt.c: New file.
* tests/setopt02.at: New test case.
|
| |
|
| |
|
|
|
|
|
| |
* src/recover.c (_gdbm_finish_transfer): Remove call to _gdbmsync_done.
* doc/gdbm.texi: Reflect the changes.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.am: Use plain git log to format the ChangeLog.
* git2chg.awk: Remove.
* NOTE-WARNING: Update.
* README: Likewise.
* README-alpha: Likewise.
* README-hacking: Likewise.
* doc/gdbm.3: Likewise.
* doc/gdbm.texi
|
| |
|
|
|
|
|
|
|
|
|
| |
That should fix https://puszcza.gnu.org.ua/support/?349
* configure.ac: Don't use obsolete macros.
Use AM_GNU_GETTEXT_REQUIRE_VERSION (and require gettext 0.19),
if available. Install a kludge for that to work on autoconf 2.69.
Don't check for libdbm and libnbml.
|
|
|
|
|
|
|
|
|
|
| |
This fixes https://oss-fuzz.com/testcase-detail/6317999997452288
and improves 4046a0af.
* src/bucket.c (gdbm_dir_entry_valid_p): Move to proto.
* src/proto.h (gdbm_dir_entry_valid_p): New inline function.
* src/gdbmseq.c (gdbm_valid_key_p): Use gdbm_dir_entry_valid_p to
validate the buffer index. Reorder the checks.
|
|
|
|
|
|
|
| |
This is a very long-standing bug that caused a loss of an avail
entry if the original avail table had odd number of entries.
* src/falloc.c (push_avail_block): Fix computation of dbf->avail->count.
|
| |
|
| |
|