summaryrefslogtreecommitdiff
path: root/coccinelle
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
parentdc90e0faae63a26a3e7aa4d285a50b1efb1ae39a (diff)
downloadsystemd-ca7410fe430eb6231aa5f402007a1692ebdb6e39.tar.gz
coccinelle: add coccinelle script for empty_or_dash() use
Diffstat (limited to 'coccinelle')
-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)