summaryrefslogtreecommitdiffstats
path: root/coccinelle/empty-or-dash.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/empty-or-dash.cocci')
-rw-r--r--coccinelle/empty-or-dash.cocci6
1 files changed, 6 insertions, 0 deletions
diff --git a/coccinelle/empty-or-dash.cocci b/coccinelle/empty-or-dash.cocci
new file mode 100644
index 0000000..56246af
--- /dev/null
+++ b/coccinelle/empty-or-dash.cocci
@@ -0,0 +1,6 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+@@
+expression s;
+@@
+- (isempty(s) || streq(s, "-"))
++ empty_or_dash(s)