diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/Modules/db_gdbm.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog index 15a02afa1..d97672317 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2017-05-28 Barton E. Schaefer <schaefer@zsh.org> + * Sebastian: 41153: Src/Modules/db_gdbm.c: finish module setup + only after all error conditions have been checked + * unposted: Doc/Zsh/mod_complist.yo: clarify ZLS_COLORS pattern matching contexts diff --git a/Src/Modules/db_gdbm.c b/Src/Modules/db_gdbm.c index 35254b68c..c4bb931a3 100644 --- a/Src/Modules/db_gdbm.c +++ b/Src/Modules/db_gdbm.c @@ -157,10 +157,7 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func)) gdbm_errno=0; dbf = gdbm_open(resource_name, 0, read_write, 0666, 0); - if(dbf) { - addmodulefd(gdbm_fdesc(dbf), FDT_MODULE); - append_tied_name(pmname); - } else { + if(dbf == NULL) { zwarnnam(nam, "error opening database file %s (%s)", resource_name, gdbm_strerror(gdbm_errno)); return 1; } @@ -172,6 +169,9 @@ bin_ztie(char *nam, char **args, Options ops, UNUSED(int func)) return 1; } + addmodulefd(gdbm_fdesc(dbf), FDT_MODULE); + append_tied_name(pmname); + tied_param->gsu.h = &gdbm_hash_gsu; /* Allocate parameter sub-gsu, fill dbf field. |