{"action":"created","comment":{"url":"https://api.github.com/repos/radare/radare2/pulls/comments/75865470","id":75865470,"diff_hunk":"@@ -372,6 +373,77 @@ R_API int r_str_word_set0(char *str) {\n \treturn i;\n }\n \n+R_API int r_str_word_set0_stack(char *str) {\n+\tint i;\n+\tchar *p, *q;\n+\tRStack *s;\n+\tvoid *pop;\n+\tif (!str || !*str) {\n+\t\treturn 0;\n+\t}\n+\tfor (i=0; str[i] && str[i+1]; i++) {\n+\t\tif (i > 0 && str[i-1] == ' ' && str[i] == ' ') {\n+\t\t\tint len = strlen (str+i)+1;\n+\t\t\tmemmove (str+i, str+i+1, len);\n+\t\t\ti--;\n+\t\t}\n+\t\tif (i == 0 && str[i] == ' ') {\n+\t\t\tmemmove (str+i, str+i+1, strlen(str+i)+1);\n+\t\t}\n+\t}\n+\tif (str[i]==' ') {\n+\t\tstr[i] = 0;\n+\t}\n+\ts = r_stack_new (5); //Some random number\n+\tfor (i = 1, p = str; *p; p++) {\n+\t\tq = p - 1;\n+\t\tif (p > str && (*q == '\\\\')) {\n+\t\t\tmemmove (q, p, strlen (p) + 1);\n+\t\t\tp--;\n+\t\t\tcontinue;\n+\t\t}\n+\t\tif (*p == '(' || *p == '{' || *p == '[') {\n+\t\t\tr_stack_push(s, (void *)p);\n+\t\t\tcontinue;\n+\t\t} else if (*p == '\\'' || *p == '\"') {\n+\t\t\tpop = r_stack_pop (s);\n+\t\t\tif (pop && *(char *)pop != *p) {\n+\t\t\t\tr_stack_push (s, pop);\n+\t\t\t\tr_stack_push (s, (void *)p);\n+\t\t\t} else if (!pop) {\n+\t\t\t\tr_stack_push (s, (void *)p);\n+\t\t\t}\n+\t\t\tcontinue;\n+\t\t} else if (*p == ')' || *p == '}' || *p == ']') {\n+\t\t\tpop = r_stack_pop (s);\n+\t\t\tif (pop) {\n+\t\t\t\tif ((*(char *)pop == '(' && *p == ')') ||\n+\t\t\t\t\t(*(char *)pop == '{' && *p == '}') ||\n+\t\t\t\t\t(*(char *)pop == '[' && *p == ']')) {\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (*p == ' ') {\n+\t\t\tif (p > str && !*q) {\n+\t\t\t\tmemmove (p, p+1, strlen (p+1)+1);","path":"libr/util/str.c","position":69,"original_position":69,"commit_id":"25c58f9ba1b00037b4d09fec1565e67bd9434f99","original_commit_id":"25c58f9ba1b00037b4d09fec1565e67bd9434f99","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"body":"spaces around +","created_at":"2016-08-23T13:33:01Z","updated_at":"2016-08-23T13:33:01Z","html_url":"https://github.com/radare/radare2/pull/5593#discussion_r75865470","pull_request_url":"https://api.github.com/repos/radare/radare2/pulls/5593","_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments/75865470"},"html":{"href":"https://github.com/radare/radare2/pull/5593#discussion_r75865470"},"pull_request":{"href":"https://api.github.com/repos/radare/radare2/pulls/5593"}}},"pull_request":{"url":"https://api.github.com/repos/radare/radare2/pulls/5593","id":82364901,"html_url":"https://github.com/radare/radare2/pull/5593","diff_url":"https://github.com/radare/radare2/pull/5593.diff","patch_url":"https://github.com/radare/radare2/pull/5593.patch","issue_url":"https://api.github.com/repos/radare/radare2/issues/5593","number":5593,"state":"open","locked":false,"title":"stack based splitting of args","user":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"body":"r_str_word_set0_stack. (works using stack taking care of nested paranthesis, brackets and braces). The test case might fail since it does not require `\"` for nested things which it did earlier.","created_at":"2016-08-23T13:31:09Z","updated_at":"2016-08-23T13:33:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a20c9a9d4800e3b774644988f7e05ece5cb703e8","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/radare/radare2/pulls/5593/commits","review_comments_url":"https://api.github.com/repos/radare/radare2/pulls/5593/comments","review_comment_url":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radare/radare2/issues/5593/comments","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/25c58f9ba1b00037b4d09fec1565e67bd9434f99","head":{"label":"P4N74:pf_morefix","ref":"pf_morefix","sha":"25c58f9ba1b00037b4d09fec1565e67bd9434f99","user":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"repo":{"id":55441644,"name":"radare2","full_name":"P4N74/radare2","owner":{"login":"P4N74","id":11134594,"avatar_url":"https://avatars.githubusercontent.com/u/11134594?v=3","gravatar_id":"","url":"https://api.github.com/users/P4N74","html_url":"https://github.com/P4N74","followers_url":"https://api.github.com/users/P4N74/followers","following_url":"https://api.github.com/users/P4N74/following{/other_user}","gists_url":"https://api.github.com/users/P4N74/gists{/gist_id}","starred_url":"https://api.github.com/users/P4N74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/P4N74/subscriptions","organizations_url":"https://api.github.com/users/P4N74/orgs","repos_url":"https://api.github.com/users/P4N74/repos","events_url":"https://api.github.com/users/P4N74/events{/privacy}","received_events_url":"https://api.github.com/users/P4N74/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/P4N74/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":true,"url":"https://api.github.com/repos/P4N74/radare2","forks_url":"https://api.github.com/repos/P4N74/radare2/forks","keys_url":"https://api.github.com/repos/P4N74/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/P4N74/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/P4N74/radare2/teams","hooks_url":"https://api.github.com/repos/P4N74/radare2/hooks","issue_events_url":"https://api.github.com/repos/P4N74/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/P4N74/radare2/events","assignees_url":"https://api.github.com/repos/P4N74/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/P4N74/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/P4N74/radare2/tags","blobs_url":"https://api.github.com/repos/P4N74/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/P4N74/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/P4N74/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/P4N74/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/P4N74/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/P4N74/radare2/languages","stargazers_url":"https://api.github.com/repos/P4N74/radare2/stargazers","contributors_url":"https://api.github.com/repos/P4N74/radare2/contributors","subscribers_url":"https://api.github.com/repos/P4N74/radare2/subscribers","subscription_url":"https://api.github.com/repos/P4N74/radare2/subscription","commits_url":"https://api.github.com/repos/P4N74/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/P4N74/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/P4N74/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/P4N74/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/P4N74/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/P4N74/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/P4N74/radare2/merges","archive_url":"https://api.github.com/repos/P4N74/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/P4N74/radare2/downloads","issues_url":"https://api.github.com/repos/P4N74/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/P4N74/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/P4N74/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/P4N74/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/P4N74/radare2/labels{/name}","releases_url":"https://api.github.com/repos/P4N74/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/P4N74/radare2/deployments","created_at":"2016-04-04T20:15:18Z","updated_at":"2016-04-04T20:15:31Z","pushed_at":"2016-08-23T13:26:21Z","git_url":"git://github.com/P4N74/radare2.git","ssh_url":"git@github.com:P4N74/radare2.git","clone_url":"https://github.com/P4N74/radare2.git","svn_url":"https://github.com/P4N74/radare2","homepage":"http://www.radare.org/","size":60508,"stargazers_count":0,"watchers_count":0,"language":"C","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":"radare:master","ref":"master","sha":"fb196362e15585c0600f8114f3e47f523f43bbfa","user":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"repo":{"id":4869294,"name":"radare2","full_name":"radare/radare2","owner":{"login":"radare","id":917142,"avatar_url":"https://avatars.githubusercontent.com/u/917142?v=3","gravatar_id":"","url":"https://api.github.com/users/radare","html_url":"https://github.com/radare","followers_url":"https://api.github.com/users/radare/followers","following_url":"https://api.github.com/users/radare/following{/other_user}","gists_url":"https://api.github.com/users/radare/gists{/gist_id}","starred_url":"https://api.github.com/users/radare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radare/subscriptions","organizations_url":"https://api.github.com/users/radare/orgs","repos_url":"https://api.github.com/users/radare/repos","events_url":"https://api.github.com/users/radare/events{/privacy}","received_events_url":"https://api.github.com/users/radare/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radare/radare2","description":"unix-like reverse engineering framework and commandline tools","fork":false,"url":"https://api.github.com/repos/radare/radare2","forks_url":"https://api.github.com/repos/radare/radare2/forks","keys_url":"https://api.github.com/repos/radare/radare2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radare/radare2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radare/radare2/teams","hooks_url":"https://api.github.com/repos/radare/radare2/hooks","issue_events_url":"https://api.github.com/repos/radare/radare2/issues/events{/number}","events_url":"https://api.github.com/repos/radare/radare2/events","assignees_url":"https://api.github.com/repos/radare/radare2/assignees{/user}","branches_url":"https://api.github.com/repos/radare/radare2/branches{/branch}","tags_url":"https://api.github.com/repos/radare/radare2/tags","blobs_url":"https://api.github.com/repos/radare/radare2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radare/radare2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radare/radare2/git/refs{/sha}","trees_url":"https://api.github.com/repos/radare/radare2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radare/radare2/statuses/{sha}","languages_url":"https://api.github.com/repos/radare/radare2/languages","stargazers_url":"https://api.github.com/repos/radare/radare2/stargazers","contributors_url":"https://api.github.com/repos/radare/radare2/contributors","subscribers_url":"https://api.github.com/repos/radare/radare2/subscribers","subscription_url":"https://api.github.com/repos/radare/radare2/subscription","commits_url":"https://api.github.com/repos/radare/radare2/commits{/sha}","git_commits_url":"https://api.github.com/repos/radare/radare2/git/commits{/sha}","comments_url":"https://api.github.com/repos/radare/radare2/comments{/number}","issue_comment_url":"https://api.github.com/repos/radare/radare2/issues/comments{/number}","contents_url":"https://api.github.com/repos/radare/radare2/contents/{+path}","compare_url":"https://api.github.com/repos/radare/radare2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radare/radare2/merges","archive_url":"https://api.github.com/repos/radare/radare2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radare/radare2/downloads","issues_url":"https://api.github.com/repos/radare/radare2/issues{/number}","pulls_url":"https://api.github.com/repos/radare/radare2/pulls{/number}","milestones_url":"https://api.github.com/repos/radare/radare2/milestones{/number}","notifications_url":"https://api.github.com/repos/radare/radare2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radare/radare2/labels{/name}","releases_url":"https://api.github.com/repos/radare/radare2/releases{/id}","deployments_url":"https://api.github.com/repos/radare/radare2/deployments","created_at":"2012-07-03T07:42:26Z","updated_at":"2016-08-23T07:45:47Z","pushed_at":"2016-08-23T13:31:09Z","git_url":"git://github.com/radare/radare2.git","ssh_url":"git@github.com:radare/radare2.git","clone_url":"https://github.com/radare/radare2.git","svn_url":"https://github.com/radare/radare2","homepage":"http://www.radare.org/","size":78564,"stargazers_count":3084,"watchers_count":3084,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":701,"mirror_url":null,"open_issues_count":803,"forks":701,"open_issues":803,"watchers":3084,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radare/radare2/pulls/5593"},"html":{"href":"https://github.com/radare/radare2/pull/5593"},"issue":{"href":"https://api.github.com/repos/radare/radare2/issues/5593"},"comments":{"href":"https://api.github.com/repos/radare/radare2/issues/5593/comments"},"review_comments":{"href":"https://api.github.com/repos/radare/radare2/pulls/5593/comments"},"review_comment":{"href":"https://api.github.com/repos/radare/radare2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radare/radare2/pulls/5593/commits"},"statuses":{"href":"https://api.github.com/repos/radare/radare2/statuses/25c58f9ba1b00037b4d09fec1565e67bd9434f99"}}}}
{"actor":{"display_login":"radare"}}