summaryrefslogtreecommitdiff
path: root/coccinelle
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-12-07 12:13:00 +0100
committerLennart Poettering <lennart@poettering.net>2017-12-07 12:13:00 +0100
commita8ea93a5e2a5d6cc2d448a42c265bac2408e0b21 (patch)
tree293aa89e43cb8816321d494c6768c865d0079c8d /coccinelle
parent3708254f3666744b095b17f8ee98ab651b12b4f3 (diff)
downloadsystemd-a8ea93a5e2a5d6cc2d448a42c265bac2408e0b21.tar.gz
systemd-a8ea93a5e2a5d6cc2d448a42c265bac2408e0b21.tar.bz2
systemd-a8ea93a5e2a5d6cc2d448a42c265bac2408e0b21.zip
core: use empty_to_null() where we can
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/empty-to-null.cocci5
1 files changed, 5 insertions, 0 deletions
diff --git a/coccinelle/empty-to-null.cocci b/coccinelle/empty-to-null.cocci
new file mode 100644
index 0000000000..fbc75b9c34
--- /dev/null
+++ b/coccinelle/empty-to-null.cocci
@@ -0,0 +1,5 @@
+@@
+expression s;
+@@
+- isempty(s) ? NULL : s
++ empty_to_null(s)