summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/dload.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index e5696bb0..506dcb8e 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -53,9 +53,11 @@ static const char *get_filename(const char *url)
{
char *filename = strrchr(url, '/');
if(filename != NULL) {
- filename++;
+ return filename + 1;
}
- return filename;
+
+ /* no slash found, it's a filename */
+ return url;
}
static char *get_fullpath(const char *path, const char *filename,