path-list: fix path-list-insert return value
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>
Junio C Hamano committed
Nov 11, 2006 at 14:45 UTC
057bc808b4aa2e7795f9bd395e68071301bc0b74
1 file changed
+1
-1
path-list.c
+1
-1
@@ -57,7 +57,7 @@ struct path_list_item *path_list_insert(const char *path, struct path_list *list
57
int index = add_entry(list, path);
58
59
if (index < 0)
60
- index = 1 - index;
60
+ index = -1 - index;
61
62
return list->items + index;
63
}