From da08e620179a7b2fbeddf2091bab8f017603c4b0 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 849c0714c70..3daf3012e1a 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