[pacman-dev] [PATCH libalpm] filecache_find_url: dereference the 'filebase' pointer
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> --- lib/libalpm/dload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 88ea427..c5a56b5 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -652,7 +652,7 @@ static char *filecache_find_url(alpm_handle_t *handle, const char *url) } filebase++; - if(filebase == '\0') { + if(*filebase == '\0') { return NULL; } -- 2.0.1
'filebase' is a pointer to char and we want to check whether the 'url' contains a filename by checking the result of strrchr points to '\0' So we have to dereference 'filebase' when doing that Nothing but the commit message has changed from v1 Signed-off-by: Ryo Munakata <ryomnktml@gmail.com> --- lib/libalpm/dload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 88ea427..c5a56b5 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -652,7 +652,7 @@ static char *filecache_find_url(alpm_handle_t *handle, const char *url) } filebase++; - if(filebase == '\0') { + if(*filebase == '\0') { return NULL; } -- 2.0.1
participants (1)
-
Ryo Munakata