diff --git a/App Launcher/script.py b/App Launcher/script.py index eae0a29..ea9ebe5 100644 --- a/App Launcher/script.py +++ b/App Launcher/script.py @@ -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: @@ -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