summaryrefslogtreecommitdiffstats
path: root/coccinelle/empty-to-root.cocci
blob: 9a65a6936f20f3268a08cb0270fa06557ca495be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
expression s;
@@
- if (empty_or_root(s))
-         s = "/";
+ s = empty_to_root(s);
@@
expression s;
@@
- (empty_or_root(s) ? "/" : s)
+ empty_to_root(s)
@@
expression s;
@@
- (s ? s : "/")
+ empty_to_root(s)