diff --git a/builtin-mv.c b/builtin-mv.c
index a3f9ad174492827e42f2854287fab19915d8ef76..94f6dd2aad2da512bab0be2e84859eced6553cc9 100644 (file)
--- a/builtin-mv.c
+++ b/builtin-mv.c
}
dst = add_slash(dst);
- dst_len = strlen(dst) - 1;
+ dst_len = strlen(dst);
for (j = 0; j < last - first; j++) {
const char *path =
source[argc + j] = path;
destination[argc + j] =
prefix_path(dst, dst_len,
- path + length);
+ path + length + 1);
modes[argc + j] = INDEX;
}
argc += last - first;
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
- close(newfd) ||
commit_locked_index(&lock_file))
die("Unable to write new index file");
}