mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-19 06:40:21 -07:00
Test unquote works as expected and fix two bugs:
* escaped end quote * a single quote character
This commit is contained in:
parent
0cd7942155
commit
f44f9569e1
2 changed files with 59 additions and 1 deletions
|
@ -264,7 +264,7 @@ def split_args(args):
|
|||
return params
|
||||
|
||||
def is_quoted(data):
|
||||
return len(data) > 0 and (data[0] == '"' and data[-1] == '"' or data[0] == "'" and data[-1] == "'")
|
||||
return len(data) > 1 and data[0] == data[-1] and data[0] in ('"', "'") and data[-2] != '\\'
|
||||
|
||||
def unquote(data):
|
||||
''' removes first and last quotes from a string, if the string starts and ends with the same quotes '''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue