summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-14 07:58:42 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-14 07:58:42 +0000
commit4470e5ce011fef0c918b5c3d1d42ae333fb361ba (patch)
tree5ce8d77cc28f688d53fdea517434f6b1f4f10f10 /lib/libalpm/package.c
parent7e835366f15f98a1688e022a781483d5c5eeb114 (diff)
downloadpacman-4470e5ce011fef0c918b5c3d1d42ae333fb361ba.tar.xz
* 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)
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c10
1 files changed, 7 insertions, 3 deletions
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);