Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #78 Fix handling of plain backslashes #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions App Launcher/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,25 +367,24 @@ def decodeArgList(argsString):
for c in argsString:
if escaping:
escaping = False

if c == ' ' or c == '"': # put these away immediately (space-delimiter or quote)
currentArg.append(c)
continue

currentArg.append('\\') # Add the backslash first
currentArg.append(c) # Add the escaped character
continue

if c == '\\':
escaping = True
continue

# not escaping or dealt with special characters, can deal with any char now

if c == ' ': # delimeter?
if not quoting:
# hit the space delimeter (outside of quotes)
if c == ' ': # delimiter?
if not quoting:
# hit the space delimiter (outside of quotes)
if len(currentArg) > 0:
argsList.append(''.join(currentArg))
del currentArg[:]
continue

continue
if c == ' ' and len(currentArg) == 0: # don't fill up with spaces
pass
else:
Expand All @@ -394,16 +393,16 @@ def decodeArgList(argsString):
if c == '"': # quoting?
if quoting: # close quote
quoting = False
argsList.append(''.join(currentArg))
del currentArg[:]
if len(currentArg) > 0:
argsList.append(''.join(currentArg))
del currentArg[:]
continue

else:
quoting = True # open quote

if len(currentArg) > 0:
argsList.append(''.join(currentArg))

argsList.append(''.join(currentArg))
return argsList


Expand Down
Loading