libxbps: use prop_array_get_cstring_nocopy().

This commit is contained in:
Juan RP 2012-06-13 09:23:48 +02:00
parent 412d4b7280
commit a3adbcda95
2 changed files with 2 additions and 13 deletions

View File

@ -170,7 +170,6 @@ find_repo_deps(prop_dictionary_t transd, /* transaction dictionary */
struct xbps_handle *xhp = xbps_handle_get(); struct xbps_handle *xhp = xbps_handle_get();
prop_dictionary_t curpkgd, tmpd; prop_dictionary_t curpkgd, tmpd;
prop_array_t curpkgrdeps, unsorted; prop_array_t curpkgrdeps, unsorted;
prop_object_t obj;
pkg_state_t state; pkg_state_t state;
size_t i, x; size_t i, x;
const char *reqpkg, *pkgver_q, *reason = NULL; const char *reqpkg, *pkgver_q, *reason = NULL;
@ -185,11 +184,7 @@ find_repo_deps(prop_dictionary_t transd, /* transaction dictionary */
* current package. * current package.
*/ */
for (i = 0; i < prop_array_count(pkg_rdeps_array); i++) { for (i = 0; i < prop_array_count(pkg_rdeps_array); i++) {
obj = prop_array_get(pkg_rdeps_array, i); prop_array_get_cstring_nocopy(pkg_rdeps_array, i, &reqpkg);
if ((reqpkg = prop_string_cstring_nocopy(obj)) == NULL) {
rv = EINVAL;
break;
}
if (xhp->flags & XBPS_FLAG_DEBUG) { if (xhp->flags & XBPS_FLAG_DEBUG) {
xbps_dbg_printf(""); xbps_dbg_printf("");
for (x = 0; x < *depth; x++) for (x = 0; x < *depth; x++)

View File

@ -189,7 +189,6 @@ sort_pkg_rundeps(prop_dictionary_t transd,
prop_array_t pkg_rundeps) prop_array_t pkg_rundeps)
{ {
prop_dictionary_t curpkgd; prop_dictionary_t curpkgd;
prop_object_t obj;
struct pkgdep *lpd, *pdn; struct pkgdep *lpd, *pdn;
const char *str, *tract; const char *str, *tract;
char *pkgnamedep; char *pkgnamedep;
@ -202,12 +201,7 @@ sort_pkg_rundeps(prop_dictionary_t transd,
again: again:
for (i = idx; i < prop_array_count(pkg_rundeps); i++) { for (i = idx; i < prop_array_count(pkg_rundeps); i++) {
obj = prop_array_get(pkg_rundeps, i); prop_array_get_cstring_nocopy(pkg_rundeps, i, &str);
str = prop_string_cstring_nocopy(obj);
if (str == NULL) {
rv = ENOMEM;
break;
}
pkgnamedep = xbps_pkgpattern_name(str); pkgnamedep = xbps_pkgpattern_name(str);
if (pkgnamedep == NULL) { if (pkgnamedep == NULL) {
rv = ENOMEM; rv = ENOMEM;