Page MenuHomePhabricator

Make Windows escaping preserve "%" symbols in arguments
ClosedPublic

Authored by epriestley on Apr 2 2020, 7:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 6:48 PM
Unknown Object (File)
Sun, Nov 24, 6:19 PM
Unknown Object (File)
Wed, Nov 20, 8:18 PM
Unknown Object (File)
Sun, Nov 17, 11:41 PM
Unknown Object (File)
Sun, Nov 17, 7:02 AM
Unknown Object (File)
Fri, Nov 15, 9:42 AM
Unknown Object (File)
Wed, Nov 13, 8:02 AM
Unknown Object (File)
Thu, Oct 31, 10:12 AM
Subscribers
None

Details

Summary

Ref T13504. Ref T13209. We currently use "escapeshellarg()" under Windows, which destructively replaces "%" symbols with spaces. This is wrong, breaks general behavior with "git log --format=...", and has led to a lot of weird workarounds in arc code where we don't escape arguments we should be escaping to tiptoe around issues with "%".

Now that execution occurs via "bypass_shell", we can safely (probably?) escape things, although programs are still apparently free to parse the command string however they want.

Test Plan

Added unit tests, ran them under Mac and Windows, got clean results. Ran "arc version" on Mac and Windows.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable