summaryrefslogtreecommitdiffstats
path: root/coccinelle/empty-or-dash.cocci
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-08 14:31:15 +0200
committerLennart Poettering <lennart@poettering.net>2019-04-08 14:31:15 +0200
commitca7410fe430eb6231aa5f402007a1692ebdb6e39 (patch)
tree14bfc5ba1af61253885ba95a76b41b050d80f012 /coccinelle/empty-or-dash.cocci
parentbasic: add new helper call empty_or_dash_to_null() (diff)
downloadsystemd-ca7410fe430eb6231aa5f402007a1692ebdb6e39.tar.xz
systemd-ca7410fe430eb6231aa5f402007a1692ebdb6e39.zip
coccinelle: add coccinelle script for empty_or_dash() use
Diffstat (limited to 'coccinelle/empty-or-dash.cocci')
-rw-r--r--coccinelle/empty-or-dash.cocci5
1 files changed, 5 insertions, 0 deletions
diff --git a/coccinelle/empty-or-dash.cocci b/coccinelle/empty-or-dash.cocci
new file mode 100644
index 0000000000..bebaead2ff
--- /dev/null
+++ b/coccinelle/empty-or-dash.cocci
@@ -0,0 +1,5 @@
+@@
+expression s;
+@@
+- (isempty(s) || streq(s, "-"))
++ empty_or_dash(s)