From 4f9fb796c4b7a53f97e32838039f117118996edc Mon Sep 17 00:00:00 2001 From: makalaaneesh Date: Fri, 8 Jan 2016 00:01:04 +0530 Subject: [PATCH] fixes #425. command had to be re escaped --- thefuck/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thefuck/utils.py b/thefuck/utils.py index 392f63fa..1770e05d 100644 --- a/thefuck/utils.py +++ b/thefuck/utils.py @@ -110,7 +110,7 @@ def get_all_executables(): def replace_argument(script, from_, to): """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) if replaced_in_the_end != script: return replaced_in_the_end