X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-mv.c;h=94f6dd2aad2da512bab0be2e84859eced6553cc9;hb=ba9f517bdd2062d1d90d37e5b10d1688d48bc225;hp=68aa2a68bb8f4232732829ba7d9459bbef3c7ad5;hpb=378b2607f07bd2fa0eaa8648e7dc8db636708d74;p=git.git diff --git a/builtin-mv.c b/builtin-mv.c index 68aa2a68b..94f6dd2aa 100644 --- a/builtin-mv.c +++ b/builtin-mv.c @@ -19,7 +19,6 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec, int count, int base_name) { int i; - int len = prefix ? strlen(prefix) : 0; const char **result = xmalloc((count + 1) * sizeof(const char *)); memcpy(result, pathspec, count * sizeof(const char *)); result[count] = NULL; @@ -33,11 +32,8 @@ static const char **copy_pathspec(const char *prefix, const char **pathspec, if (last_slash) result[i] = last_slash + 1; } - result[i] = prefix_path(prefix, len, result[i]); - if (!result[i]) - exit(1); /* error already given */ } - return result; + return get_pathspec(prefix, result); } static void show_list(const char *label, struct path_list *list)