Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'diffcore-rename.c')
-rw-r--r--diffcore-rename.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c
index 2618bb07c1..c95857b51f 100644
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -448,9 +448,9 @@ static void update_dir_rename_counts(struct dir_rename_info *info,
const char *oldname,
const char *newname)
{
- char *old_dir = xstrdup(oldname);
- char *new_dir = xstrdup(newname);
- char new_dir_first_char = new_dir[0];
+ char *old_dir;
+ char *new_dir;
+ const char new_dir_first_char = newname[0];
int first_time_in_loop = 1;
if (!info->setup)
@@ -475,6 +475,10 @@ static void update_dir_rename_counts(struct dir_rename_info *info,
*/
return;
+
+ old_dir = xstrdup(oldname);
+ new_dir = xstrdup(newname);
+
while (1) {
int drd_flag = NOT_RELEVANT;