gitweb: only display "next" links in logs if there is a next page
[gitweb.git] / builtin-mv.c
index 990e21355d189096bdc0c808fb536b7bfb85b0a1..94f6dd2aad2da512bab0be2e84859eced6553cc9 100644 (file)
@@ -164,7 +164,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                                }
 
                                dst = add_slash(dst);
-                               dst_len = strlen(dst) - 1;
+                               dst_len = strlen(dst);
 
                                for (j = 0; j < last - first; j++) {
                                        const char *path =
@@ -172,7 +172,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
                                        source[argc + j] = path;
                                        destination[argc + j] =
                                                prefix_path(dst, dst_len,
-                                                       path + length);
+                                                       path + length + 1);
                                        modes[argc + j] = INDEX;
                                }
                                argc += last - first;