Fixed: [Need to add the possibility to use anchors around patterns #51](https://github.com/clicon/cligen/issues/51):

* Dont escape `$` if it is last in a regexp in translation from XML to POSIX.
This commit is contained in:
Olof hagsand 2020-07-27 20:03:52 +02:00
parent 918bf6223b
commit 9d2102cebf
3 changed files with 188 additions and 169 deletions

View file

@ -179,7 +179,7 @@ regexp_xsd2posix(char *xsd,
}
else if (x == '\\')
esc++;
else if (x == '$')
else if (x == '$' && i != strlen(xsd)-1) /* Escape $ unless it is last */
cprintf(cb, "\\%c", x);
else if (x == ']' && minus){
cprintf(cb, "-]");