1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-18 06:03:42 +03:00
systemd-stable/coccinelle/empty-to-null.cocci

10 lines
266 B
Plaintext
Raw Normal View History

/* SPDX-License-Identifier: LGPL-2.1-or-later */
2017-12-07 12:13:00 +01:00
@@
/* Avoid running this transformation on the empty_to_null function itself */
position p : script:python() { p[0].current_element != "empty_to_null" };
2017-12-07 12:13:00 +01:00
expression s;
@@
- isempty@p(s) ? NULL : s
2017-12-07 12:13:00 +01:00
+ empty_to_null(s)