aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-10-31 02:40:23 +0000
committerMike Frysinger <vapier@gentoo.org>2013-10-31 02:40:23 +0000
commitcfa635a498be962662b70c8e84b1e5547520c7bb (patch)
tree8380a5970520cbc0c4299570d645d0bc3246a694
parentmove all headers includes and such to a single porting.h to avoid duplicating... (diff)
downloadportage-utils-0.41.tar.gz
portage-utils-0.41.tar.bz2
portage-utils-0.41.zip
fix bug related to var parsing w/out bracesv0.41
-rw-r--r--main.c4
-rwxr-xr-xtests/profile/dotest3
-rw-r--r--tests/profile/profile1/etc/portage/make.conf3
3 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index 9f93e42..f982cfa 100644
--- a/main.c
+++ b/main.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2013 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.228 2013/09/29 22:42:36 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/main.c,v 1.229 2013/10/31 02:40:23 vapier Exp $
*
* Copyright 2005-2008 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2013 Mike Frysinger - <vapier@gentoo.org>
@@ -752,7 +752,7 @@ void initialize_portage_env(void)
}
*svar = byte;
slen = strlen(sval);
- post_len = strlen(svar + 1);
+ post_len = strlen(svar + !!brace);
*var->value.s = xrealloc(*var->value.s, pre_len + MAX(var_len, slen) + post_len + 1);
/*
diff --git a/tests/profile/dotest b/tests/profile/dotest
index 68618b7..b4e94c5 100755
--- a/tests/profile/dotest
+++ b/tests/profile/dotest
@@ -53,4 +53,7 @@ tenv 1 ACCEPT_LICENSE lic
tenv 1 PORTAGE_BINHOST http://someurl/
tenv 1 NOCOLOR 1
+# this validates pathological vars
+tenv 1 PKGDIR " "
+
end
diff --git a/tests/profile/profile1/etc/portage/make.conf b/tests/profile/profile1/etc/portage/make.conf
index fc26522..5c5d190 100644
--- a/tests/profile/profile1/etc/portage/make.conf
+++ b/tests/profile/profile1/etc/portage/make.conf
@@ -17,3 +17,6 @@ INSTALL_MASK="$INSTALL_MASK
PORTAGE_BINHOST="http://someurl/" # this is a comment
NOCOLOR=1 # this is a comment
+
+# Catch a bug with var parsing.
+PKGDIR="$PREFLIGHT_BINHOST $FULL_BINHOST"