Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dead code in Config.a_single_param #238

Open
reynir opened this issue Apr 25, 2024 · 0 comments
Open

Dead code in Config.a_single_param #238

reynir opened this issue Apr 25, 2024 · 0 comments

Comments

@reynir
Copy link
Contributor

reynir commented Apr 25, 2024

The conditional here will always be false:

miragevpn/src/config.ml

Lines 800 to 808 in a401e2c

( take_while (function
| ' ' | '\t' | '\'' | '"' | '\n' -> false
| _ -> true)
>>= fun v ->
if
String.(contains_from v (min 0 @@ length v) '\'')
|| String.(contains_from v (min 0 @@ length v) '"')
then fail "unquoted parameter contains quote"
else return v );

because we only take non-whitespace and non-quote characters we will never have any quote characters. It might be enough to remove the matches on '\'' and '"'. I'm not sure I understand what the code is supposed to do.

We should probably use a_single_param more - at least I was somewhat unaware of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant