HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

coccinelle/empty-to-root.cocci

Git blob: 9a65a6936f20f3268a08cb0270fa06557ca495be

Lines 1–18 of 18

/* 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)