Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'rs/strbuf-cocci-workaround'
author
Junio C Hamano
<gitster@pobox.com>
Tue, 13 Feb 2018 21:39:12 +0000
(13:39 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 13 Feb 2018 21:39:12 +0000
(13:39 -0800)
Update Coccinelle rules to catch and optimize strbuf_addf(&buf, "%s", str)
* rs/strbuf-cocci-workaround:
cocci: use format keyword instead of a literal string
contrib/coccinelle/strbuf.cocci
patch
|
blob
|
history
raw
(from parent 1:
2b72ea0
)
diff --git
a/contrib/coccinelle/strbuf.cocci
b/contrib/coccinelle/strbuf.cocci
index 1d580e49b0ca3304ad7b3be62664df47ea84757d..6fe8727421101efc04c15d8c6def448984eff74d 100644
(file)
--- a/
contrib/coccinelle/strbuf.cocci
+++ b/
contrib/coccinelle/strbuf.cocci
@@
-29,8
+29,9
@@
cocci.include_match("%" not in fmt)
@@
expression E1, E2;
+format F =~ "s";
@@
-- strbuf_addf(E1, "%
s
", E2);
+- strbuf_addf(E1, "%
@F@
", E2);
+ strbuf_addstr(E1, E2);
@@