aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo.c
diff options
context:
space:
mode:
Diffstat (limited to 'pseudo.c')
-rw-r--r--pseudo.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/pseudo.c b/pseudo.c
index df2a419..db1c400 100644
--- a/pseudo.c
+++ b/pseudo.c
@@ -496,13 +496,10 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon
/* For a rename op, we want to strip any trailing
* slashes. For xattr, "oldpath" is the raw data
* to be stored. */
- if (msg->op == OP_RENAME) {
- if (oldpathlen > 0 && oldpath[oldpathlen - 1] == '/') {
+ if (oldpathlen > 0 && msg->op == OP_RENAME) {
+ if (oldpath[oldpathlen - 1] == '/') {
oldpath[--oldpathlen] = '\0';
}
- } else {
- /* disregard the trailing null */
- --oldpathlen;
}
/* if we got an oldpath, but a 0-length initial
* path, we don't want to act as though we had