]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix line number reporting on config file errors after <inline> segments
authorGert Doering <gert@greenie.muc.de>
Sun, 6 Dec 2020 12:57:11 +0000 (13:57 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 6 Dec 2020 18:23:29 +0000 (19:23 +0100)
commita686f7e29af012783371f401f394ac1e62e5b75f
tree880e07bcd0560c56dd39dbd0189d777332eb1668
parent1387f52682dcd3789c56c9979ccedca281ff88f4
Fix line number reporting on config file errors after <inline> segments

<inline> segments neglected to increment the "current line number
in config file" variable (line_num), so after the first <inline>,
errors reported have the wrong line number.

Fix by introducing an extra argument to read_inline_file() function:
"so many lines in the inline block", and changing the return values of
the "check_inline*()" functions to "int", changing this from "false/true"
to "0 = no inline, 1...N = inline with <N> lines".

On calling add_options() this is implicitly converted back to bool.

v2: use int return value, not extra call-by-reference parameter

Trac: #1325
Acked-by: Antonio Quartulli <antonio@openvpn.net>
Message-Id: <20201206125711.12071-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg21334.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/options.c