Michael Newton
2015-02-28 00:18:17 UTC
Iâve come across a bit of an odd problem in clogin, I believe it shows up
with prompts that are ten characters long, and the tenth character would
need escaping if it were put in a regex.
I modified clogin to show me what it was building for a prompt and this is
what I saw:
(ThisLong) #
reprompt is \(ThisLong\([^#>\r\n]+)?[#>](\([^)\r\n]+\))?
(ThisIsLonger) #
reprompt is \(ThisIsLon([^#>\r\n]+)?[#>](\([^)\r\n]+\))?
Notice on the shorter prompt, the parenthesis in the regex ends up being
escaped, I suspect because the prompt is being escaped and then trimmed.
The problem code is right near the top of run_commands().
Mike
with prompts that are ten characters long, and the tenth character would
need escaping if it were put in a regex.
I modified clogin to show me what it was building for a prompt and this is
what I saw:
(ThisLong) #
reprompt is \(ThisLong\([^#>\r\n]+)?[#>](\([^)\r\n]+\))?
(ThisIsLonger) #
reprompt is \(ThisIsLon([^#>\r\n]+)?[#>](\([^)\r\n]+\))?
Notice on the shorter prompt, the parenthesis in the regex ends up being
escaped, I suspect because the prompt is being escaped and then trimmed.
The problem code is right near the top of run_commands().
Mike