xbps_alternatives_register: no need to check for 'alloc'.
Found by @huglovefan. Thanks. Signed-off-by: Juan RP <xtraeme@gmail.com>
This commit is contained in:
parent
5913205dcf
commit
f06edd8850
@ -461,14 +461,12 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
|
|||||||
xbps_array_t array;
|
xbps_array_t array;
|
||||||
xbps_object_t keysym;
|
xbps_object_t keysym;
|
||||||
const char *keyname;
|
const char *keyname;
|
||||||
bool alloc = false;
|
|
||||||
|
|
||||||
keysym = xbps_array_get(allkeys, i);
|
keysym = xbps_array_get(allkeys, i);
|
||||||
keyname = xbps_dictionary_keysym_cstring_nocopy(keysym);
|
keyname = xbps_dictionary_keysym_cstring_nocopy(keysym);
|
||||||
|
|
||||||
array = xbps_dictionary_get(alternatives, keyname);
|
array = xbps_dictionary_get(alternatives, keyname);
|
||||||
if (array == NULL) {
|
if (array == NULL) {
|
||||||
alloc = true;
|
|
||||||
array = xbps_array_create();
|
array = xbps_array_create();
|
||||||
} else {
|
} else {
|
||||||
/* already registered */
|
/* already registered */
|
||||||
@ -487,7 +485,6 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
|
|||||||
xbps_dictionary_set(alternatives, keyname, array);
|
xbps_dictionary_set(alternatives, keyname, array);
|
||||||
xbps_set_cb_state(xhp, XBPS_STATE_ALTGROUP_ADDED, 0, NULL,
|
xbps_set_cb_state(xhp, XBPS_STATE_ALTGROUP_ADDED, 0, NULL,
|
||||||
"%s: registered '%s' alternatives group", pkgver, keyname);
|
"%s: registered '%s' alternatives group", pkgver, keyname);
|
||||||
if (alloc) {
|
|
||||||
/* apply alternatives for this group */
|
/* apply alternatives for this group */
|
||||||
rv = create_symlinks(xhp,
|
rv = create_symlinks(xhp,
|
||||||
xbps_dictionary_get(pkg_alternatives, keyname),
|
xbps_dictionary_get(pkg_alternatives, keyname),
|
||||||
@ -496,7 +493,6 @@ xbps_alternatives_register(struct xbps_handle *xhp, xbps_dictionary_t pkg_repod)
|
|||||||
if (rv != 0)
|
if (rv != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
xbps_object_release(allkeys);
|
xbps_object_release(allkeys);
|
||||||
free(pkgname);
|
free(pkgname);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user