aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-10-14 22:00:24 +0000
committerMike Frysinger <vapier@gentoo.org>2006-10-14 22:00:24 +0000
commit7b2b976856e81d7b9b657d041cfa7e559d021d90 (patch)
treea8493a02fc4f05379b85906d602d44744b40c7c7 /libq/atom_explode.c
parent- ferringb wants to break the portage vdb CONTENTS file by using tabs vs spac... (diff)
downloadportage-utils-7b2b976856e81d7b9b657d041cfa7e559d021d90.tar.gz
portage-utils-7b2b976856e81d7b9b657d041cfa7e559d021d90.tar.bz2
portage-utils-7b2b976856e81d7b9b657d041cfa7e559d021d90.zip
handle wankers who name things like pam_p11-0.1.2 #151329
Diffstat (limited to 'libq/atom_explode.c')
-rw-r--r--libq/atom_explode.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libq/atom_explode.c b/libq/atom_explode.c
index d69e766..6d1ebba 100644
--- a/libq/atom_explode.c
+++ b/libq/atom_explode.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/atom_explode.c,v 1.14 2006/01/24 00:28:14 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/libq/atom_explode.c,v 1.15 2006/10/14 22:00:24 vapier Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -101,16 +101,21 @@ retry_suffix:
if ((ptr = strstr(ptr_tmp, atom_suffixes_str[i])) == NULL)
continue;
- /* check this is a real suffix and not _p hitting mod_perl */
- /* note: '_suff-' in $PN is accepted, but no one uses that ... */
+ /* check this is a real suffix and not _p hitting mod_perl.
+ * we need to scan the whole suffix to handle crap like
+ * sys-auth/pam_p11-0.1.2 */
len = strlen(ptr);
slen = strlen(atom_suffixes_str[i]);
if (slen > len) continue;
- if (ptr[slen] && !isdigit(ptr[slen]) && ptr[slen]!='-') {
- /* ok, it was a fake out ... lets skip this
- * fake and try to match the suffix again */
- ptr_tmp = ptr + 1;
- goto retry_suffix;
+ while (slen < len) {
+ if (ptr[slen] && !isdigit(ptr[slen]) && ptr[slen]!='-') {
+ /* ok, it was a fake out ... lets skip this
+ * fake and try to match the suffix again
+ */
+ ptr_tmp = ptr + 1;
+ goto retry_suffix;
+ }
+ ++slen;
}
ret->suffix = i;