From 4470e5ce011fef0c918b5c3d1d42ae333fb361ba Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 14 Nov 2006 07:58:42 +0000 Subject: * Numerous mini valgrind fixes. * Addition of hacky architecture check in the _splitname function * Removal of libfetch from the archlinux proper - it has been renamed to libdownload and can be found at http://phraktured.net/libdownload * Merge of _some_ of the Frugalware makepkg change - this may still be incomplete * Removal of libftp from cvs proper * PKGBUILD manpage now says 'PKGBUILD' instead of FrugalBuild (he he) --- lib/libalpm/package.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 16e0dc32..2686c00c 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -435,7 +435,7 @@ pmpkg_t *_alpm_pkg_isin(char *needle, pmlist_t *haystack) return(NULL); } -int _alpm_pkg_splitname(char *target, char *name, char *version) +int _alpm_pkg_splitname(char *target, char *name, char *version, int witharch) { char tmp[PKG_FULLNAME_LEN+7]; char *p, *q; @@ -453,7 +453,11 @@ int _alpm_pkg_splitname(char *target, char *name, char *version) STRNCPY(tmp, p, PKG_FULLNAME_LEN+7); /* trim file extension (if any) */ if((p = strstr(tmp, PM_EXT_PKG))) { - *p = 0; + *p = '\0'; + } + + if((p = _alpm_pkgname_has_arch(tmp))) { + *p = '\0'; } p = tmp + strlen(tmp); @@ -469,7 +473,7 @@ int _alpm_pkg_splitname(char *target, char *name, char *version) if(version) { STRNCPY(version, p+1, PKG_VERSION_LEN); } - *p = 0; + *p = '\0'; if(name) { STRNCPY(name, tmp, PKG_NAME_LEN); -- cgit v1.2.3-54-g00ecf