basic/env-file: also change to state PRE_KEY if we see NEWLINE in state COMMENT_ESCAPE
authorlicunlong <licunlong1@huawei.com>
Mon, 19 Jun 2023 13:56:33 +0000 (21:56 +0800)
committerlicunlong <licunlong1@huawei.com>
Tue, 20 Jun 2023 06:42:44 +0000 (14:42 +0800)
commitcd93ec5ed2e9eaa1dfdf06e5910d46488f7dcda2
tree30ef0eeea98d5d31d9a1e9de1ee01e59a24af28b
parent24945c28db8969b1f4487771febc7244eae03b83
basic/env-file: also change to state PRE_KEY if we see NEWLINE in state COMMENT_ESCAPE

When we see a "\" in COMMENT state, we change the state to COMMENT_ESCAPE. When we got
a new character, we reset the state to COMMENT, but this character is not dispatched.
Usually the character is NEWLINE, if so we will stay in COMMENT state until we find
the next NEWLINE.

fix: https://github.com/systemd/systemd/issues/27975
src/basic/env-file.c
src/test/test-env-file.c