Skip to content

Dead code in Config.a_single_param #238

Open
@reynir

Description

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.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions