@matheusbsbs / matheus-bagliano / commits / c607aaa2f0
Fork 0

builtin-apply.c: pass ws_rule down to match_fragment()

This is necessary to allow match_fragment() to attempt a match with a preimage that is based on a version before whitespace errors were fixed. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 30, 2008 at 15:13 UTC c607aaa2f05b4dc38a6573f44b6f71db05dd8b39
1 file changed +5 -3
builtin-apply.c
+5 -3
@@ -1614,6 +1614,7 @@ static int match_fragment(struct image *img,
1614 struct image *postimage,
1615 unsigned long try,
1616 int try_lno,
1617 + unsigned ws_rule,
1618 int match_beginning, int match_end)
1619 {
1620 int i;
@@ -1656,6 +1657,7 @@ static int find_pos(struct image *img,
1657 struct image *preimage,
1658 struct image *postimage,
1659 int line,
1660 + unsigned ws_rule,
1661 int match_beginning, int match_end)
1662 {
1663 int i;
@@ -1691,7 +1693,7 @@ static int find_pos(struct image *img,
1693
1694 for (i = 0; ; i++) {
1695 if (match_fragment(img, preimage, postimage,
1694 - try, try_lno,
1696 + try, try_lno, ws_rule,
1697 match_beginning, match_end))
1698 return try_lno;
1699
@@ -1930,8 +1932,8 @@ static int apply_one_fragment(struct image *img, struct fragment *frag,
1932
1933 for (;;) {
1934
1933 - applied_pos = find_pos(img, &preimage, &postimage,
1934 - pos, match_beginning, match_end);
1935 + applied_pos = find_pos(img, &preimage, &postimage, pos,
1936 + ws_rule, match_beginning, match_end);
1937
1938 if (applied_pos >= 0)
1939 break;