Skip to content
Snippets Groups Projects
Commit 3db4a854 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

BufFix: validate parenthese on EOF.

See comment line 290 at parse_bracket function.
parent b6e0c9d8
No related branches found
No related tags found
No related merge requests found
......@@ -279,10 +279,28 @@ int parse_bracket(stack *store, const char *str, const int sid)
}
}
if (vp && (o == len)) {
if (o == len) {
/** end of string. this validate the parenthese */
bracket-- ;
o = lvp ;
if (vp) {
bracket-- ;
o = lvp ;
} else {
/** EOF can be reached without a valid parentheses.
* Typically,
*
* Options = ( log )
* UnknownKey = InvalidValues
* EOF
*
* The EOF is reached and vp is marked invalid. In this case,
* we validate the closed parenthese found by the lexer.*/
if (cfg.str[cfg.cpos] == ')') {
bracket-- ;
o = 1 ;
}
}
}
o -= 1 ; // remove the last bracket
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment