Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/server.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/server.c')
-rw-r--r--lib/libalpm/server.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c
index 51f389d9..b426ccb5 100644
--- a/lib/libalpm/server.c
+++ b/lib/libalpm/server.c
@@ -190,12 +190,15 @@ int _alpm_downloadfiles_forreal(alpm_list_t *servers, const char *localpath,
}
/* Try to get JUST the name of the package from the filename */
- p = alpm_pkg_name_hasarch(fn); /* TODO remove this later */
- _alpm_pkg_splitname(fn, pkgname, NULL, (p != NULL));
+ memset(pkgname, 0, PKG_NAME_LEN);
+ if((p = strstr(fn, PM_EXT_PKG))) {
+ _alpm_pkg_splitname(fn, pkgname, NULL, 1);
+ }
if(!strlen(pkgname)) {
/* just use the raw filename if we can't find crap */
- STRNCPY(pkgname, fn, PKG_NAME_LEN);
+ STRNCPY(pkgname, fn, PKG_NAME_LEN+1);
}
+ _alpm_log(PM_LOG_DEBUG, _("using '%s' for download progress"), pkgname);
snprintf(realfile, PATH_MAX, "%s/%s", localpath, fn);
snprintf(output, PATH_MAX, "%s/%s.part", localpath, fn);