{"action":"created","comment":{"url":"https://api.github.com/repos/toddr/IPC-Run/pulls/comments/59467645","id":59467645,"diff_hunk":"@@ -444,8 +444,15 @@ sub win32_spawn {\n \n    my $process;\n    my $cmd_line = join \" \", map {\n-      ( my $s = $_ ) =~ s/\"/\"\"\"/g;\n-      $s = qq{\"$s\"} if /[\\\"\\s]|^$/;\n+      my $s = $_;\n+      if ($s eq \"\") {\n+         $s = '\"\"';\n+      } elsif ($s =~ /[\\s\"]/) {\n+         # Double-quotes will be escaped with a backslash, and any backslash\n+         # that immediately precedes a double-quote will also be escaped.\n+         $s =~ s/(\\\\*)\"/$1$1\\\\\"/g;","path":"lib/IPC/Run/Win32Helper.pm","position":12,"original_position":12,"commit_id":"b17a3416ad674e7b4993aaad35da667d665ee2c6","original_commit_id":"b17a3416ad674e7b4993aaad35da667d665ee2c6","user":{"login":"toddr","id":97892,"avatar_url":"https://avatars.githubusercontent.com/u/97892?v=3","gravatar_id":"","url":"https://api.github.com/users/toddr","html_url":"https://github.com/toddr","followers_url":"https://api.github.com/users/toddr/followers","following_url":"https://api.github.com/users/toddr/following{/other_user}","gists_url":"https://api.github.com/users/toddr/gists{/gist_id}","starred_url":"https://api.github.com/users/toddr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddr/subscriptions","organizations_url":"https://api.github.com/users/toddr/orgs","repos_url":"https://api.github.com/users/toddr/repos","events_url":"https://api.github.com/users/toddr/events{/privacy}","received_events_url":"https://api.github.com/users/toddr/received_events","type":"User","site_admin":false},"body":"\\\\* would match on nothing. so doing this recursively seems like it'd be a problem.","created_at":"2016-04-12T22:48:12Z","updated_at":"2016-04-12T22:48:12Z","html_url":"https://github.com/toddr/IPC-Run/pull/12#discussion_r59467645","pull_request_url":"https://api.github.com/repos/toddr/IPC-Run/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/comments/59467645"},"html":{"href":"https://github.com/toddr/IPC-Run/pull/12#discussion_r59467645"},"pull_request":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/toddr/IPC-Run/pulls/12","id":49242621,"html_url":"https://github.com/toddr/IPC-Run/pull/12","diff_url":"https://github.com/toddr/IPC-Run/pull/12.diff","patch_url":"https://github.com/toddr/IPC-Run/pull/12.patch","issue_url":"https://api.github.com/repos/toddr/IPC-Run/issues/12","number":12,"state":"open","locked":false,"title":"Improve command argument escaping on windows","user":{"login":"lfbayer","id":995620,"avatar_url":"https://avatars.githubusercontent.com/u/995620?v=3","gravatar_id":"","url":"https://api.github.com/users/lfbayer","html_url":"https://github.com/lfbayer","followers_url":"https://api.github.com/users/lfbayer/followers","following_url":"https://api.github.com/users/lfbayer/following{/other_user}","gists_url":"https://api.github.com/users/lfbayer/gists{/gist_id}","starred_url":"https://api.github.com/users/lfbayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfbayer/subscriptions","organizations_url":"https://api.github.com/users/lfbayer/orgs","repos_url":"https://api.github.com/users/lfbayer/repos","events_url":"https://api.github.com/users/lfbayer/events{/privacy}","received_events_url":"https://api.github.com/users/lfbayer/received_events","type":"User","site_admin":false},"body":"I ran into an issue where passing an argument with a double-quote in it didn't work on windows.\r\n\r\nAfter some investigation I found this page http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx\r\n\r\nIt seems to be that using \"\"\" to escape a quote isn't the correct way to do the escaping. I'm curious in what cases was this working before as it is?\r\n\r\nThis pull request changes the command argument escaping for windows to escape double quotes with a backslash, and also any backslashes that precede a double quote with another double quote.\r\n\r\nLet me know if there is some compatibility issue I am missing.","created_at":"2015-10-30T08:28:11Z","updated_at":"2016-04-12T22:48:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1fe2337add7fdf7e6d774fadbdd25f5bff3fb768","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/toddr/IPC-Run/pulls/12/commits","review_comments_url":"https://api.github.com/repos/toddr/IPC-Run/pulls/12/comments","review_comment_url":"https://api.github.com/repos/toddr/IPC-Run/pulls/comments{/number}","comments_url":"https://api.github.com/repos/toddr/IPC-Run/issues/12/comments","statuses_url":"https://api.github.com/repos/toddr/IPC-Run/statuses/b17a3416ad674e7b4993aaad35da667d665ee2c6","head":{"label":"lfbayer:win32cmd","ref":"win32cmd","sha":"b17a3416ad674e7b4993aaad35da667d665ee2c6","user":{"login":"lfbayer","id":995620,"avatar_url":"https://avatars.githubusercontent.com/u/995620?v=3","gravatar_id":"","url":"https://api.github.com/users/lfbayer","html_url":"https://github.com/lfbayer","followers_url":"https://api.github.com/users/lfbayer/followers","following_url":"https://api.github.com/users/lfbayer/following{/other_user}","gists_url":"https://api.github.com/users/lfbayer/gists{/gist_id}","starred_url":"https://api.github.com/users/lfbayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfbayer/subscriptions","organizations_url":"https://api.github.com/users/lfbayer/orgs","repos_url":"https://api.github.com/users/lfbayer/repos","events_url":"https://api.github.com/users/lfbayer/events{/privacy}","received_events_url":"https://api.github.com/users/lfbayer/received_events","type":"User","site_admin":false},"repo":{"id":45237509,"name":"IPC-Run","full_name":"lfbayer/IPC-Run","owner":{"login":"lfbayer","id":995620,"avatar_url":"https://avatars.githubusercontent.com/u/995620?v=3","gravatar_id":"","url":"https://api.github.com/users/lfbayer","html_url":"https://github.com/lfbayer","followers_url":"https://api.github.com/users/lfbayer/followers","following_url":"https://api.github.com/users/lfbayer/following{/other_user}","gists_url":"https://api.github.com/users/lfbayer/gists{/gist_id}","starred_url":"https://api.github.com/users/lfbayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfbayer/subscriptions","organizations_url":"https://api.github.com/users/lfbayer/orgs","repos_url":"https://api.github.com/users/lfbayer/repos","events_url":"https://api.github.com/users/lfbayer/events{/privacy}","received_events_url":"https://api.github.com/users/lfbayer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lfbayer/IPC-Run","description":"Clone of http://svn.ali.as/cpan/trunk/IPC-Run","fork":true,"url":"https://api.github.com/repos/lfbayer/IPC-Run","forks_url":"https://api.github.com/repos/lfbayer/IPC-Run/forks","keys_url":"https://api.github.com/repos/lfbayer/IPC-Run/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lfbayer/IPC-Run/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lfbayer/IPC-Run/teams","hooks_url":"https://api.github.com/repos/lfbayer/IPC-Run/hooks","issue_events_url":"https://api.github.com/repos/lfbayer/IPC-Run/issues/events{/number}","events_url":"https://api.github.com/repos/lfbayer/IPC-Run/events","assignees_url":"https://api.github.com/repos/lfbayer/IPC-Run/assignees{/user}","branches_url":"https://api.github.com/repos/lfbayer/IPC-Run/branches{/branch}","tags_url":"https://api.github.com/repos/lfbayer/IPC-Run/tags","blobs_url":"https://api.github.com/repos/lfbayer/IPC-Run/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lfbayer/IPC-Run/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lfbayer/IPC-Run/git/refs{/sha}","trees_url":"https://api.github.com/repos/lfbayer/IPC-Run/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lfbayer/IPC-Run/statuses/{sha}","languages_url":"https://api.github.com/repos/lfbayer/IPC-Run/languages","stargazers_url":"https://api.github.com/repos/lfbayer/IPC-Run/stargazers","contributors_url":"https://api.github.com/repos/lfbayer/IPC-Run/contributors","subscribers_url":"https://api.github.com/repos/lfbayer/IPC-Run/subscribers","subscription_url":"https://api.github.com/repos/lfbayer/IPC-Run/subscription","commits_url":"https://api.github.com/repos/lfbayer/IPC-Run/commits{/sha}","git_commits_url":"https://api.github.com/repos/lfbayer/IPC-Run/git/commits{/sha}","comments_url":"https://api.github.com/repos/lfbayer/IPC-Run/comments{/number}","issue_comment_url":"https://api.github.com/repos/lfbayer/IPC-Run/issues/comments{/number}","contents_url":"https://api.github.com/repos/lfbayer/IPC-Run/contents/{+path}","compare_url":"https://api.github.com/repos/lfbayer/IPC-Run/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lfbayer/IPC-Run/merges","archive_url":"https://api.github.com/repos/lfbayer/IPC-Run/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lfbayer/IPC-Run/downloads","issues_url":"https://api.github.com/repos/lfbayer/IPC-Run/issues{/number}","pulls_url":"https://api.github.com/repos/lfbayer/IPC-Run/pulls{/number}","milestones_url":"https://api.github.com/repos/lfbayer/IPC-Run/milestones{/number}","notifications_url":"https://api.github.com/repos/lfbayer/IPC-Run/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lfbayer/IPC-Run/labels{/name}","releases_url":"https://api.github.com/repos/lfbayer/IPC-Run/releases{/id}","deployments_url":"https://api.github.com/repos/lfbayer/IPC-Run/deployments","created_at":"2015-10-30T08:10:37Z","updated_at":"2015-10-30T08:10:37Z","pushed_at":"2015-11-02T05:35:27Z","git_url":"git://github.com/lfbayer/IPC-Run.git","ssh_url":"git@github.com:lfbayer/IPC-Run.git","clone_url":"https://github.com/lfbayer/IPC-Run.git","svn_url":"https://github.com/lfbayer/IPC-Run","homepage":"http://search.cpan.org/dist/IPC-Run/","size":658,"stargazers_count":0,"watchers_count":0,"language":"Perl","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"toddr:master","ref":"master","sha":"9208afd19080c3f149b504c83b5e60a062b72682","user":{"login":"toddr","id":97892,"avatar_url":"https://avatars.githubusercontent.com/u/97892?v=3","gravatar_id":"","url":"https://api.github.com/users/toddr","html_url":"https://github.com/toddr","followers_url":"https://api.github.com/users/toddr/followers","following_url":"https://api.github.com/users/toddr/following{/other_user}","gists_url":"https://api.github.com/users/toddr/gists{/gist_id}","starred_url":"https://api.github.com/users/toddr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddr/subscriptions","organizations_url":"https://api.github.com/users/toddr/orgs","repos_url":"https://api.github.com/users/toddr/repos","events_url":"https://api.github.com/users/toddr/events{/privacy}","received_events_url":"https://api.github.com/users/toddr/received_events","type":"User","site_admin":false},"repo":{"id":1970269,"name":"IPC-Run","full_name":"toddr/IPC-Run","owner":{"login":"toddr","id":97892,"avatar_url":"https://avatars.githubusercontent.com/u/97892?v=3","gravatar_id":"","url":"https://api.github.com/users/toddr","html_url":"https://github.com/toddr","followers_url":"https://api.github.com/users/toddr/followers","following_url":"https://api.github.com/users/toddr/following{/other_user}","gists_url":"https://api.github.com/users/toddr/gists{/gist_id}","starred_url":"https://api.github.com/users/toddr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddr/subscriptions","organizations_url":"https://api.github.com/users/toddr/orgs","repos_url":"https://api.github.com/users/toddr/repos","events_url":"https://api.github.com/users/toddr/events{/privacy}","received_events_url":"https://api.github.com/users/toddr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/toddr/IPC-Run","description":"Clone of http://svn.ali.as/cpan/trunk/IPC-Run","fork":false,"url":"https://api.github.com/repos/toddr/IPC-Run","forks_url":"https://api.github.com/repos/toddr/IPC-Run/forks","keys_url":"https://api.github.com/repos/toddr/IPC-Run/keys{/key_id}","collaborators_url":"https://api.github.com/repos/toddr/IPC-Run/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/toddr/IPC-Run/teams","hooks_url":"https://api.github.com/repos/toddr/IPC-Run/hooks","issue_events_url":"https://api.github.com/repos/toddr/IPC-Run/issues/events{/number}","events_url":"https://api.github.com/repos/toddr/IPC-Run/events","assignees_url":"https://api.github.com/repos/toddr/IPC-Run/assignees{/user}","branches_url":"https://api.github.com/repos/toddr/IPC-Run/branches{/branch}","tags_url":"https://api.github.com/repos/toddr/IPC-Run/tags","blobs_url":"https://api.github.com/repos/toddr/IPC-Run/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/toddr/IPC-Run/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/toddr/IPC-Run/git/refs{/sha}","trees_url":"https://api.github.com/repos/toddr/IPC-Run/git/trees{/sha}","statuses_url":"https://api.github.com/repos/toddr/IPC-Run/statuses/{sha}","languages_url":"https://api.github.com/repos/toddr/IPC-Run/languages","stargazers_url":"https://api.github.com/repos/toddr/IPC-Run/stargazers","contributors_url":"https://api.github.com/repos/toddr/IPC-Run/contributors","subscribers_url":"https://api.github.com/repos/toddr/IPC-Run/subscribers","subscription_url":"https://api.github.com/repos/toddr/IPC-Run/subscription","commits_url":"https://api.github.com/repos/toddr/IPC-Run/commits{/sha}","git_commits_url":"https://api.github.com/repos/toddr/IPC-Run/git/commits{/sha}","comments_url":"https://api.github.com/repos/toddr/IPC-Run/comments{/number}","issue_comment_url":"https://api.github.com/repos/toddr/IPC-Run/issues/comments{/number}","contents_url":"https://api.github.com/repos/toddr/IPC-Run/contents/{+path}","compare_url":"https://api.github.com/repos/toddr/IPC-Run/compare/{base}...{head}","merges_url":"https://api.github.com/repos/toddr/IPC-Run/merges","archive_url":"https://api.github.com/repos/toddr/IPC-Run/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/toddr/IPC-Run/downloads","issues_url":"https://api.github.com/repos/toddr/IPC-Run/issues{/number}","pulls_url":"https://api.github.com/repos/toddr/IPC-Run/pulls{/number}","milestones_url":"https://api.github.com/repos/toddr/IPC-Run/milestones{/number}","notifications_url":"https://api.github.com/repos/toddr/IPC-Run/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/toddr/IPC-Run/labels{/name}","releases_url":"https://api.github.com/repos/toddr/IPC-Run/releases{/id}","deployments_url":"https://api.github.com/repos/toddr/IPC-Run/deployments","created_at":"2011-06-29T03:12:09Z","updated_at":"2015-11-19T09:10:43Z","pushed_at":"2016-04-12T22:46:05Z","git_url":"git://github.com/toddr/IPC-Run.git","ssh_url":"git@github.com:toddr/IPC-Run.git","clone_url":"https://github.com/toddr/IPC-Run.git","svn_url":"https://github.com/toddr/IPC-Run","homepage":"http://search.cpan.org/dist/IPC-Run/","size":648,"stargazers_count":7,"watchers_count":7,"language":"Perl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":9,"forks":14,"open_issues":9,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/12"},"html":{"href":"https://github.com/toddr/IPC-Run/pull/12"},"issue":{"href":"https://api.github.com/repos/toddr/IPC-Run/issues/12"},"comments":{"href":"https://api.github.com/repos/toddr/IPC-Run/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/toddr/IPC-Run/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/toddr/IPC-Run/statuses/b17a3416ad674e7b4993aaad35da667d665ee2c6"}}}}