aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-02-20 17:38:35 -0500
committerMike Frysinger <vapier@gentoo.org>2015-02-20 17:38:35 -0500
commit4ec8b2852f194709aca48be26888fd52c0f09c2f (patch)
tree1db277cf3c749c57877364590d23954e79ca40ee
parentqcheck: add a short option for --skip-protected (diff)
downloadportage-utils-4ec8b2852f194709aca48be26888fd52c0f09c2f.tar.gz
portage-utils-4ec8b2852f194709aca48be26888fd52c0f09c2f.tar.bz2
portage-utils-4ec8b2852f194709aca48be26888fd52c0f09c2f.zip
tests: atom_explode: update cache location
-rwxr-xr-xtests/atom_explode/dotest4
-rw-r--r--tests/atom_explode/test.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/atom_explode/dotest b/tests/atom_explode/dotest
index 3b134e2..c4dc913 100755
--- a/tests/atom_explode/dotest
+++ b/tests/atom_explode/dotest
@@ -2,8 +2,8 @@
. ../init.sh
-[[ $PORTDIR == "" ]] && PORTDIR=$(portageq envvar PORTDIR)
-pushd ${PORTDIR}/metadata/cache >/dev/null || { echo SKIPPED; exit 0 ; }
+: ${PORTDIR:=$(portageq envvar PORTDIR)}
+pushd "${PORTDIR}"/metadata/md5-cache >/dev/null || { echo SKIPPED; exit 0 ; }
if [[ $1 == -v ]] ; then
find . -mindepth 2 -type f -printf '%P\n%f\n' | while read line ; do
diff --git a/tests/atom_explode/test.c b/tests/atom_explode/test.c
index d9e80e7..ef05a69 100644
--- a/tests/atom_explode/test.c
+++ b/tests/atom_explode/test.c
@@ -29,12 +29,15 @@ int main(int argc, char *argv[])
atom_implode(a);
}
if (argc == 1) {
- char buf[1024], *p;
- while (fgets(buf, sizeof(buf), stdin) != NULL) {
+ size_t buflen;
+ char *buf, *p;
+
+ buf = NULL;
+ while (getline(&buf, &buflen, stdin) != -1) {
if ((p = strchr(buf, '\n')) != NULL)
*p = '\0';
a = atom_explode(buf);
- boom(a,buf);
+ boom(a, buf);
atom_implode(a);
}
}