You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use of sub! in run_command results in spurious capture/replacement of \& sequences. #131
run_command performs xml.sub!(escaped_cmd, escaped_cmd.gsub(/'/, "'")) to work around a framework issue from #73 but sub looks for backreferences in the replacement string. Doing Regexp.escape on the replacement string should correct this but this seems like going around one's head to touch one's nose but I can't think of a simpler way to do it.
A real-life example of this occurring is when you pass "" anywhere in your command because it gets escaped to "" which causes & to be captured.
Activity
mwrock commentedon Mar 24, 2015
Hey @ksubrama do you think you could add a test for this in https://github.com/WinRb/WinRM/blob/master/spec/cmd_spec.rb ? In addition to defending from regressions it would also better illustrate your example above. Thanks!
ksubrama commentedon Mar 24, 2015
Done! Let me know if this is enough. I actually found an issue with my initial implementation in the process. The current version passes all tests.
ksubrama commentedon Mar 26, 2015
@mwrock =^.^=
sneal commentedon Mar 31, 2015
Merged the PR, thanks guys.