systemd/coccinelle/empty-to-root.cocci
2020-10-01 11:02:11 +02:00

16 lines
212 B
Text

@@
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)