summaryrefslogtreecommitdiff
path: root/coccinelle/strempty.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/strempty.cocci')
-rw-r--r--coccinelle/strempty.cocci10
1 files changed, 10 insertions, 0 deletions
diff --git a/coccinelle/strempty.cocci b/coccinelle/strempty.cocci
new file mode 100644
index 0000000000..e3bd0a1f56
--- /dev/null
+++ b/coccinelle/strempty.cocci
@@ -0,0 +1,10 @@
+@@
+expression s;
+@@
+- s ?: ""
++ strempty(s)
+@@
+expression s;
+@@
+- s ? s : ""
++ strempty(s)