holzschu / ios_system

Drop-in replacement for system() in iOS programs
BSD 3-Clause "New" or "Revised" License
902 stars 147 forks source link

Fix arguments parsing with " inside #145

Closed yury closed 1 year ago

yury commented 1 year ago

Hello Nicolas 👋

This PR partially fix issue with parsing quoted arguments.

For instance,

ssh "user name"@localhost produced [ssh, user name, localhost] argv.

With this PR it will produce [ssh, \"user name\"@localhost] argv.

Not ideal, but a least we can handle that inside command.

Ideal fix would be to also fix unquoteArgument function https://github.com/holzschu/ios_system/blob/6a83eb1c6c383a562fbe33a7e97677e88d305b51/ios_system.m#L2442-L2447

But fix require new allocations, so I decided that this PR is good for the start.

holzschu commented 1 year ago

Hi Yury, thanks a lot. It makes a lot of sense. I'm merging.