mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
473de9b708
The original issue with this transformation was that we were replacing the whole if statement instead of just the expression inside. That caused the code to be weirdly formatted, as Coccinelle put a new block around each replaced if statement. This version replaces just the inner expression if it's in its incorrect form, otherwise it just accepts it (to avoid recursion).
30 lines
169 B
Plaintext
30 lines
169 B
Plaintext
@@
|
|
expression e;
|
|
statement s;
|
|
@@
|
|
if (
|
|
(
|
|
!e
|
|
|
|
|
- e == NULL
|
|
+ !e
|
|
)
|
|
)
|
|
{...}
|
|
else s
|
|
|
|
@@
|
|
expression e;
|
|
statement s;
|
|
@@
|
|
if (
|
|
(
|
|
e
|
|
|
|
|
- e != NULL
|
|
+ e
|
|
)
|
|
)
|
|
{...}
|
|
else s
|