Merge branch 'rs/cocci-strbuf-addf-to-addstr'
[git] / contrib / coccinelle / strbuf.cocci
1 @ strbuf_addf_with_format_only @
2 expression E;
3 constant fmt !~ "%";
4 @@
5 - strbuf_addf
6 + strbuf_addstr
7   (E,
8 (
9   fmt
10 |
11   _(fmt)
12 )
13   );
14
15 @@
16 expression E1, E2;
17 format F =~ "s";
18 @@
19 - strbuf_addf(E1, "%@F@", E2);
20 + strbuf_addstr(E1, E2);
21
22 @@
23 expression E1, E2, E3;
24 @@
25 - strbuf_addstr(E1, find_unique_abbrev(E2, E3));
26 + strbuf_add_unique_abbrev(E1, E2, E3);
27
28 @@
29 expression E1, E2;
30 @@
31 - strbuf_addstr(E1, real_path(E2));
32 + strbuf_add_real_path(E1, E2);