summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-11-15 17:47:28 (EST)
committer graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2010-11-15 17:47:28 (EST)
commitdcb875bea220d4eddd6b398046e91d3781083fe6 (patch)
tree92c16fc62cc1a3f9fe7a91ce5efe0a79983f858e
parent039e4e5e6dbc0dde28dbd958078abc15c1c0d8b2 (diff)
opkg_find_package() should not return garbage if it cannot find the package.
From juliosao via Issue #69. git-svn-id: http://opkg.googlecode.com/svn/trunk@579 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libopkg/opkg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libopkg/opkg.c b/libopkg/opkg.c
index b36dc1b..6d97789 100644
--- a/libopkg/opkg.c
+++ b/libopkg/opkg.c
@@ -778,6 +778,7 @@ pkg_t *
opkg_find_package(const char *name, const char *ver, const char *arch,
const char *repo)
{
+ int pkg_found = 0;
pkg_t *pkg = NULL;
pkg_vec_t *all;
int i;
@@ -815,12 +816,13 @@ opkg_find_package(const char *name, const char *ver, const char *arch,
}
/* match found */
+ pkg_found = 1;
break;
}
pkg_vec_free(all);
- return pkg;
+ return pkg_found ? pkg : NULL;
}
/**