index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2006-11-14 07:58:42 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-11-14 07:58:42 +0000 |
commit | 4470e5ce011fef0c918b5c3d1d42ae333fb361ba (patch) | |
tree | 5ce8d77cc28f688d53fdea517434f6b1f4f10f10 /lib/libalpm/package.c | |
parent | 7e835366f15f98a1688e022a781483d5c5eeb114 (diff) |
-rw-r--r-- | lib/libalpm/package.c | 10 |
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); |