Skip to content
New issue

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

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add percent escaping for string.gsub #1991

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

Tomalak
Copy link
Contributor

@Tomalak Tomalak commented Dec 19, 2018

In string.gsub(), the % character has special meaning and must be escaped to be treated verbatim, otherwise the "invalid use of '%' in replacement string" warning will show up.

This adds a verbatim() function for that purpose. It fixes this warning for situations where % characters are in the current path (cwd), version control branch names, or in the previous PROMPT set by the user.

In `string.gsub()`, the `%` character has special meaning and must be escaped to be treated verbatim, otherwise the "invalid use of '%' in replacement string" warning will show up.

This adds a verbatim() function for that purpose. It fixes this warning for situations where `'%` characters are in the current path (cwd), version control branch names, or in the previous `PROMPT` set by the user.
@Stanzilla Stanzilla merged commit 51e75d4 into cmderdev:master Dec 19, 2018
@Tomalak Tomalak deleted the fix_clink_lua branch December 20, 2018 06:50
@Tomalak Tomalak restored the fix_clink_lua branch January 15, 2019 14:05
@Tomalak Tomalak deleted the fix_clink_lua branch January 15, 2019 14:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants