mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Fix broken resolve_path function
Removed some unneeded path munging so that our relative paths resolve properly. This closes FS#7068 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
This commit is contained in:
parent
9d9ac66bb2
commit
1ef27e97a1
@ -43,16 +43,7 @@ extern pmdb_t *db_local;
|
||||
|
||||
static char *resolve_path(const char* file)
|
||||
{
|
||||
char *copy, *p, *str = NULL;
|
||||
|
||||
if(!(copy = strdup(file))) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
if((p = strrchr(copy, '/')) == NULL) {
|
||||
return(copy);
|
||||
} else {
|
||||
*p = '\0'; ++p;
|
||||
char *str = NULL;
|
||||
|
||||
str = calloc(PATH_MAX+1, sizeof(char));
|
||||
if(!str) {
|
||||
@ -64,11 +55,6 @@ static char *resolve_path(const char* file)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
str[strlen(str)] = '/';
|
||||
strcat(str, p);
|
||||
}
|
||||
|
||||
free(copy);
|
||||
return(str);
|
||||
}
|
||||
|
||||
@ -115,7 +101,7 @@ static void query_fileowner(pmdb_t *db, char *filename)
|
||||
ppath = resolve_path(path);
|
||||
|
||||
if(ppath && strcmp(ppath, rpath) == 0) {
|
||||
printf(_("%s is owned by %s %s\n"), filename, alpm_pkg_get_name(info), alpm_pkg_get_version(info));
|
||||
printf(_("%s is owned by %s %s\n"), rpath, alpm_pkg_get_name(info), alpm_pkg_get_version(info));
|
||||
found = 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user