From 9f34ea54f51d0d3f90e6d258bb3916c4d94d8b5b Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 11 Aug 2014 09:34:14 -0500 Subject: [PATCH] Correct parser to ignore escaped quotes when not in quotes already Related to #8481 --- lib/ansible/module_utils/splitter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/splitter.py b/lib/ansible/module_utils/splitter.py index 849c0714c7..3daf3012e1 100644 --- a/lib/ansible/module_utils/splitter.py +++ b/lib/ansible/module_utils/splitter.py @@ -26,9 +26,9 @@ def _get_quote_state(token, quote_char): for idx, cur_char in enumerate(token): if idx > 0: prev_char = token[idx-1] - if cur_char in '"\'': + if cur_char in '"\'' and prev_char != '\\': if quote_char: - if cur_char == quote_char and prev_char != '\\': + if cur_char == quote_char: quote_char = None else: quote_char = cur_char