From 8eec41dea151b200097281f1711e6b7a09621a6c Mon Sep 17 00:00:00 2001 From: Yury Korolev Date: Fri, 18 Aug 2023 14:32:06 +0300 Subject: [PATCH] Fix arguments parsing with " inside --- ios_system.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ios_system.m b/ios_system.m index 21cda631..1e84da03 100644 --- a/ios_system.m +++ b/ios_system.m @@ -2406,7 +2406,9 @@ void replaceCommand(NSString* commandName, NSString* functionName, bool allOccur write[0] = 0; return getLastCharacterOfArgument(endquote + 1); } - return endquote + 1; + // After quote non space character, we should continue till space: + // `ssh "user name"@localhost` + return nextUnescapedCharacter(endquote + 1, ' '); } return NULL; } else if (argument[0] == '\'') { @@ -2426,7 +2428,9 @@ void replaceCommand(NSString* commandName, NSString* functionName, bool allOccur write[0] = 0; return getLastCharacterOfArgument(endquote); } - return endquote + 1; + // After quote non space character, we should continue till space + // `ssh "user name"@localhost` + return nextUnescapedCharacter(endquote + 1, ' '); } return NULL; } else if (argument[0] == recordSeparator) {