diff options
Diffstat (limited to 'diffcore-rename.c')
| -rw-r--r-- | diffcore-rename.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/diffcore-rename.c b/diffcore-rename.c index 7e6b3e1b14..bebd4ed6a4 100644 --- a/diffcore-rename.c +++ b/diffcore-rename.c @@ -450,9 +450,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) @@ -477,6 +477,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; @@ -1093,7 +1097,7 @@ static int too_many_rename_candidates(int num_destinations, int num_sources, * memory for the matrix anyway. */ if (rename_limit <= 0) - rename_limit = 32767; + return 0; /* treat as unlimited */ if (st_mult(num_destinations, num_sources) <= st_mult(rename_limit, rename_limit)) return 0; |
