alpm_depend_t is an exposed data type.  Front-ends may opt for alloc'ing
one and filling the fields manually, but alpm's _alpm_hash_sdbm is not
exposed, making it impossible for them to fill in the name_hash field.

Signed-off-by: Andrew Gregory <[email protected]>
---
 lib/libalpm/handle.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 02af2dc..babd49d 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -590,6 +590,8 @@ int SYMEXPORT alpm_option_add_assumeinstalled(alpm_handle_t 
*handle, const alpm_
                        RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1));
        ASSERT((depcpy = _alpm_dep_dup(dep)), RET_ERR(handle, ALPM_ERR_MEMORY, 
-1));
 
+       /* fill in name_hash in case dep was built by hand */
+       depcpy->name_hash = _alpm_hash_sdbm(dep->name);
        handle->assumeinstalled = alpm_list_add(handle->assumeinstalled, 
depcpy);
        return 0;
 }
-- 
2.4.6

Reply via email to