summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-09-19 13:17:16 -0500
committerDan McGee <dan@archlinux.org>2011-09-19 13:17:16 -0500
commita94ad2974031138dbb4d42a939dfc0cd15a75ce7 (patch)
tree3052b8921e8fdc8c2460fe5c68b0a2c66cd4c035 /lib
parent41d8deff88ed7bdaf1820882687fb99107f60d2a (diff)
downloadpacman-a94ad2974031138dbb4d42a939dfc0cd15a75ce7.tar.xz
Search for non-prefixed paths in skip_remove list
We add them to this list with the root path not appended; we should be searching for them this way as well. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/remove.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 8021702e..c6a3efcb 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -216,12 +216,12 @@ static int can_remove_file(alpm_handle_t *handle, const alpm_file_t *file,
{
char filepath[PATH_MAX];
- snprintf(filepath, PATH_MAX, "%s%s", handle->root, file->name);
-
- if(alpm_list_find_str(skip_remove, filepath)) {
+ if(alpm_list_find_str(skip_remove, file->name)) {
/* return success because we will never actually remove this file */
return 1;
}
+
+ snprintf(filepath, PATH_MAX, "%s%s", handle->root, file->name);
/* If we fail write permissions due to a read-only filesystem, abort.
* Assume all other possible failures are covered somewhere else */
if(_alpm_access(handle, NULL, filepath, W_OK) == -1) {