diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-09 00:39:22 (EDT) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2009-03-09 00:39:22 (EDT) |
commit | 3d39889a7b2689be560a92b4d0bf1e086e6605b2 (patch) | |
tree | d144982228f0718183f21582807f01d7fba5bbfb /libopkg/pkg.c | |
parent | 81777847f4e745f75504ae1767d49f0711e56b1b (diff) |
because of the file_hash_set_file_owner may break the file list of pkgs
it should be iterated more carefully.
Dealing with
http://code.google.com/p/opkg/issues/detail?id=9
git-svn-id: http://opkg.googlecode.com/svn/trunk@204 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg/pkg.c')
-rw-r--r-- | libopkg/pkg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libopkg/pkg.c b/libopkg/pkg.c index 98a929c..6e0f396 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -1761,12 +1761,14 @@ int pkg_info_preinstall_check(opkg_conf_t *conf) for (i = 0; i < installed_pkgs->len; i++) { pkg_t *pkg = installed_pkgs->pkgs[i]; str_list_t *installed_files = pkg_get_installed_files(pkg); /* this causes installed_files to be cached */ - str_list_elt_t *iter; + str_list_elt_t *iter, *niter; if (installed_files == NULL) { opkg_message(conf, OPKG_ERROR, "No installed files for pkg %s\n", pkg->name); break; } - for (iter = str_list_first(installed_files); iter; iter = str_list_next(installed_files, iter)) { + for (iter = str_list_first(installed_files), niter = str_list_next(installed_files, iter); + iter; + iter = niter, niter = str_list_next(installed_files, iter)) { char *installed_file = (char *) iter->data; // opkg_message(conf, OPKG_DEBUG2, "pkg %s: file=%s\n", pkg->name, installed_file); file_hash_set_file_owner(conf, installed_file, pkg); |