Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Escape path strings to avoid tripping up the regex #233

Merged
merged 1 commit into from Jun 21, 2012

Conversation

Projects
None yet
3 participants
Contributor

bklang commented Jun 14, 2012

This prevents tmp directories like "/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG" from causing RegexpError exceptions like "nested *?+ in regexp: /^/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG/"

Escape path strings to avoid tripping up the regex
This prevents tmp directories like "/var/folders/TT/TTeZp5JaF4y7rWPBqCM44U+++TI/-Tmp-/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG" from causing RegexpError exceptions like "nested *?+ in regexp: /^\/var\/folders\/TT\/TTeZp5JaF4y7rWPBqCM44U+++TI\/-Tmp-\/HcLtmr36-K3cA-F9vK-1FGl-hTrvaUr1BISG/"
Contributor

bklang commented Jun 14, 2012

And to dispel possible confusion, the escaped forward-slashes in the output were from Ruby's output, not the actual content of the string.

sferik added a commit that referenced this pull request Jun 21, 2012

Merge pull request #233 from bklang/patch-1
Escape path strings to avoid tripping up the regex

@sferik sferik merged commit dfdc2aa into erikhuda:master Jun 21, 2012

Contributor

josevalim commented Jun 29, 2012

ECOMMON bros, this pull request should have tests. I have pushed a test and a similar fix (which matches the regexp just once).

Owner

sferik commented Jun 29, 2012

Sorry bro, my fault.

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