Imported Upstream version 2.16.3
[platform/upstream/git.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 @@
18 - strbuf_addf(E1, "%s", E2);
19 + strbuf_addstr(E1, E2);
20
21 @@
22 expression E1, E2, E3;
23 @@
24 - strbuf_addstr(E1, find_unique_abbrev(E2, E3));
25 + strbuf_add_unique_abbrev(E1, E2, E3);
26
27 @@
28 expression E1, E2;
29 @@
30 - strbuf_addstr(E1, real_path(E2));
31 + strbuf_add_real_path(E1, E2);