summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-03-03 18:29:09 -0500
committerAllan McRae <allan@archlinux.org>2014-03-04 13:59:46 +1000
commit2e9602716c4586ccb1b54eda4718f4dd53399f99 (patch)
tree9c58d1805b7534e79807ff54ccebfe68f00b509d /src
parent2330a6458976f20e6039ddbb5a0e00ea939b392a (diff)
downloadpacman-2e9602716c4586ccb1b54eda4718f4dd53399f99.tar.xz
simplify check for leading "local/"
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/remove.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index 00bd3b3b..933e6f72 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -94,13 +94,10 @@ int pacman_remove(alpm_list_t *targets)
/* Step 1: add targets to the created transaction */
for(i = targets; i; i = alpm_list_next(i)) {
char *target = i->data;
- char *targ = strchr(target, '/');
- if(targ && strncmp(target, "local", 5) == 0) {
- targ++;
- } else {
- targ = target;
+ if(strncmp(target, "local/", 6) == 0) {
+ target += 6;
}
- if(remove_target(targ) == -1) {
+ if(remove_target(target) == -1) {
retval = 1;
}
}