mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-19 04:21:14 +00:00
fixes #425. command had to be re escaped
This commit is contained in:
parent
1b12cd85e9
commit
4f9fb796c4
@ -110,7 +110,7 @@ def get_all_executables():
|
|||||||
|
|
||||||
def replace_argument(script, from_, to):
|
def replace_argument(script, from_, to):
|
||||||
"""Replaces command line argument."""
|
"""Replaces command line argument."""
|
||||||
replaced_in_the_end = re.sub(u' {}$'.format(from_), u' {}'.format(to),
|
replaced_in_the_end = re.sub(u' {}$'.format(re.escape(from_)), u' {}'.format(to),
|
||||||
script, count=1)
|
script, count=1)
|
||||||
if replaced_in_the_end != script:
|
if replaced_in_the_end != script:
|
||||||
return replaced_in_the_end
|
return replaced_in_the_end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user