From 9228fef0d6ba495b6c1bc697b88d8728421b5394 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Jul 2019 12:08:47 +0200 Subject: tree-wide: use empty-to-root a bit more --- coccinelle/empty-to-root.cocci | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 coccinelle/empty-to-root.cocci (limited to 'coccinelle') diff --git a/coccinelle/empty-to-root.cocci b/coccinelle/empty-to-root.cocci new file mode 100644 index 0000000000..45627c9801 --- /dev/null +++ b/coccinelle/empty-to-root.cocci @@ -0,0 +1,11 @@ +@@ +expression s; +@@ +- if (empty_or_root(s)) +- s = "/"; ++ s = empty_to_root(s); +@@ +expression s; +@@ +- (empty_or_root(s) ? "/" : s) ++ empty_to_root(s) -- cgit v1.2.1