Skip to content

Commit

Permalink
path-list: fix path-list-insert return value
Browse files Browse the repository at this point in the history
When path-list-insert is called on an existing path, it returned an
unrelated element in the list.  Luckily most of the callers are
ignoring the return value, but merge-recursive uses it at three places
and this would have resulted in a bogus rename detection.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 11, 2006
1 parent a6ec3c1 commit 057bc80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion path-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct path_list_item *path_list_insert(const char *path, struct path_list *list
int index = add_entry(list, path);

if (index < 0)
index = 1 - index;
index = -1 - index;

return list->items + index;
}
Expand Down

0 comments on commit 057bc80

Please sign in to comment.