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, Apr 14, 9:52 PM
Unknown Object (File)
Thu, Apr 11, 8:19 AM
Unknown Object (File)
Sun, Apr 7, 2:59 PM
Unknown Object (File)
Sat, Mar 30, 9:08 AM
Unknown Object (File)
Thu, Mar 21, 2:34 AM
Unknown Object (File)
Mar 16 2024, 6:19 AM
Unknown Object (File)
Jan 23 2024, 7:40 PM
Unknown Object (File)
Jan 18 2024, 8:54 PM
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
Branch
windows2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23971
Build 32988: Run Core Tests
Build 32987: arc lint + arc unit