{"action":"created","comment":{"url":"https://api.github.com/repos/mpv-player/mpv/pulls/comments/53175132","id":53175132,"diff_hunk":"@@ -100,7 +100,8 @@ int bstrspn(struct bstr str, const char *accept)\n \n int bstr_find(struct bstr haystack, struct bstr needle)\n {\n-    for (int i = 0; i < haystack.len; i++)\n+    size_t n = haystack.len > needle.len ? haystack.len - needle.len + 1 : 0;\n+    for (int i = 0; i < n; i++)\n         if (bstr_startswith(bstr_splice(haystack, i, haystack.len), needle))","path":"misc/bstr.c","position":7,"original_position":7,"commit_id":"63425a3013571044bf53627589d81122969537d4","original_commit_id":"63425a3013571044bf53627589d81122969537d4","user":{"login":"kwkam","id":16373649,"avatar_url":"https://avatars.githubusercontent.com/u/16373649?v=3","gravatar_id":"","url":"https://api.github.com/users/kwkam","html_url":"https://github.com/kwkam","followers_url":"https://api.github.com/users/kwkam/followers","following_url":"https://api.github.com/users/kwkam/following{/other_user}","gists_url":"https://api.github.com/users/kwkam/gists{/gist_id}","starred_url":"https://api.github.com/users/kwkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwkam/subscriptions","organizations_url":"https://api.github.com/users/kwkam/orgs","repos_url":"https://api.github.com/users/kwkam/repos","events_url":"https://api.github.com/users/kwkam/events{/privacy}","received_events_url":"https://api.github.com/users/kwkam/received_events","type":"User","site_admin":false},"body":"`bstr_startswith(struct bstr str, struct bstr prefix)` will always return `false` if `str.len < prefix.len`\r\nWhen length of `bstr_splice(haystack, i, haystack.len)` is less than `needle`, this function should return already","created_at":"2016-02-17T15:00:04Z","updated_at":"2016-02-17T15:00:04Z","html_url":"https://github.com/mpv-player/mpv/pull/2834#discussion_r53175132","pull_request_url":"https://api.github.com/repos/mpv-player/mpv/pulls/2834","_links":{"self":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/comments/53175132"},"html":{"href":"https://github.com/mpv-player/mpv/pull/2834#discussion_r53175132"},"pull_request":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/2834"}}},"pull_request":{"url":"https://api.github.com/repos/mpv-player/mpv/pulls/2834","id":59623542,"html_url":"https://github.com/mpv-player/mpv/pull/2834","diff_url":"https://github.com/mpv-player/mpv/pull/2834.diff","patch_url":"https://github.com/mpv-player/mpv/pull/2834.patch","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/2834","number":2834,"state":"open","locked":false,"title":"More fuzzy sub-auto","user":{"login":"kwkam","id":16373649,"avatar_url":"https://avatars.githubusercontent.com/u/16373649?v=3","gravatar_id":"","url":"https://api.github.com/users/kwkam","html_url":"https://github.com/kwkam","followers_url":"https://api.github.com/users/kwkam/followers","following_url":"https://api.github.com/users/kwkam/following{/other_user}","gists_url":"https://api.github.com/users/kwkam/gists{/gist_id}","starred_url":"https://api.github.com/users/kwkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwkam/subscriptions","organizations_url":"https://api.github.com/users/kwkam/orgs","repos_url":"https://api.github.com/users/kwkam/repos","events_url":"https://api.github.com/users/kwkam/events{/privacy}","received_events_url":"https://api.github.com/users/kwkam/received_events","type":"User","site_admin":false},"body":"Split the name of both files, by some common delimiters, into parts and compare them\r\neg. `\"xx - yyyy\"`, `\"(xx) yyyy\"`, `\"[xx][yyyy]\"` will be broken into `{ \"xx\", \"yyyy\" }`","created_at":"2016-02-17T10:28:01Z","updated_at":"2016-02-17T15:00:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d4eb44e46948a5d58f88dd29beda6b7bd2e3b75","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mpv-player/mpv/pulls/2834/commits","review_comments_url":"https://api.github.com/repos/mpv-player/mpv/pulls/2834/comments","review_comment_url":"https://api.github.com/repos/mpv-player/mpv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/2834/comments","statuses_url":"https://api.github.com/repos/mpv-player/mpv/statuses/63425a3013571044bf53627589d81122969537d4","head":{"label":"kwkam:patch-1","ref":"patch-1","sha":"63425a3013571044bf53627589d81122969537d4","user":{"login":"kwkam","id":16373649,"avatar_url":"https://avatars.githubusercontent.com/u/16373649?v=3","gravatar_id":"","url":"https://api.github.com/users/kwkam","html_url":"https://github.com/kwkam","followers_url":"https://api.github.com/users/kwkam/followers","following_url":"https://api.github.com/users/kwkam/following{/other_user}","gists_url":"https://api.github.com/users/kwkam/gists{/gist_id}","starred_url":"https://api.github.com/users/kwkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwkam/subscriptions","organizations_url":"https://api.github.com/users/kwkam/orgs","repos_url":"https://api.github.com/users/kwkam/repos","events_url":"https://api.github.com/users/kwkam/events{/privacy}","received_events_url":"https://api.github.com/users/kwkam/received_events","type":"User","site_admin":false},"repo":{"id":51912021,"name":"mpv","full_name":"kwkam/mpv","owner":{"login":"kwkam","id":16373649,"avatar_url":"https://avatars.githubusercontent.com/u/16373649?v=3","gravatar_id":"","url":"https://api.github.com/users/kwkam","html_url":"https://github.com/kwkam","followers_url":"https://api.github.com/users/kwkam/followers","following_url":"https://api.github.com/users/kwkam/following{/other_user}","gists_url":"https://api.github.com/users/kwkam/gists{/gist_id}","starred_url":"https://api.github.com/users/kwkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kwkam/subscriptions","organizations_url":"https://api.github.com/users/kwkam/orgs","repos_url":"https://api.github.com/users/kwkam/repos","events_url":"https://api.github.com/users/kwkam/events{/privacy}","received_events_url":"https://api.github.com/users/kwkam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kwkam/mpv","description":"Video player based on MPlayer/mplayer2","fork":true,"url":"https://api.github.com/repos/kwkam/mpv","forks_url":"https://api.github.com/repos/kwkam/mpv/forks","keys_url":"https://api.github.com/repos/kwkam/mpv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kwkam/mpv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kwkam/mpv/teams","hooks_url":"https://api.github.com/repos/kwkam/mpv/hooks","issue_events_url":"https://api.github.com/repos/kwkam/mpv/issues/events{/number}","events_url":"https://api.github.com/repos/kwkam/mpv/events","assignees_url":"https://api.github.com/repos/kwkam/mpv/assignees{/user}","branches_url":"https://api.github.com/repos/kwkam/mpv/branches{/branch}","tags_url":"https://api.github.com/repos/kwkam/mpv/tags","blobs_url":"https://api.github.com/repos/kwkam/mpv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kwkam/mpv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kwkam/mpv/git/refs{/sha}","trees_url":"https://api.github.com/repos/kwkam/mpv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kwkam/mpv/statuses/{sha}","languages_url":"https://api.github.com/repos/kwkam/mpv/languages","stargazers_url":"https://api.github.com/repos/kwkam/mpv/stargazers","contributors_url":"https://api.github.com/repos/kwkam/mpv/contributors","subscribers_url":"https://api.github.com/repos/kwkam/mpv/subscribers","subscription_url":"https://api.github.com/repos/kwkam/mpv/subscription","commits_url":"https://api.github.com/repos/kwkam/mpv/commits{/sha}","git_commits_url":"https://api.github.com/repos/kwkam/mpv/git/commits{/sha}","comments_url":"https://api.github.com/repos/kwkam/mpv/comments{/number}","issue_comment_url":"https://api.github.com/repos/kwkam/mpv/issues/comments{/number}","contents_url":"https://api.github.com/repos/kwkam/mpv/contents/{+path}","compare_url":"https://api.github.com/repos/kwkam/mpv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kwkam/mpv/merges","archive_url":"https://api.github.com/repos/kwkam/mpv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kwkam/mpv/downloads","issues_url":"https://api.github.com/repos/kwkam/mpv/issues{/number}","pulls_url":"https://api.github.com/repos/kwkam/mpv/pulls{/number}","milestones_url":"https://api.github.com/repos/kwkam/mpv/milestones{/number}","notifications_url":"https://api.github.com/repos/kwkam/mpv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kwkam/mpv/labels{/name}","releases_url":"https://api.github.com/repos/kwkam/mpv/releases{/id}","deployments_url":"https://api.github.com/repos/kwkam/mpv/deployments","created_at":"2016-02-17T09:48:58Z","updated_at":"2016-02-17T09:49:07Z","pushed_at":"2016-02-17T14:39:54Z","git_url":"git://github.com/kwkam/mpv.git","ssh_url":"git@github.com:kwkam/mpv.git","clone_url":"https://github.com/kwkam/mpv.git","svn_url":"https://github.com/kwkam/mpv","homepage":"https://mpv.io","size":71591,"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":"mpv-player:master","ref":"master","sha":"3dfb07854b3143d59681fd65f7dd7c3ba65e1d2f","user":{"login":"mpv-player","id":2550273,"avatar_url":"https://avatars.githubusercontent.com/u/2550273?v=3","gravatar_id":"","url":"https://api.github.com/users/mpv-player","html_url":"https://github.com/mpv-player","followers_url":"https://api.github.com/users/mpv-player/followers","following_url":"https://api.github.com/users/mpv-player/following{/other_user}","gists_url":"https://api.github.com/users/mpv-player/gists{/gist_id}","starred_url":"https://api.github.com/users/mpv-player/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpv-player/subscriptions","organizations_url":"https://api.github.com/users/mpv-player/orgs","repos_url":"https://api.github.com/users/mpv-player/repos","events_url":"https://api.github.com/users/mpv-player/events{/privacy}","received_events_url":"https://api.github.com/users/mpv-player/received_events","type":"Organization","site_admin":false},"repo":{"id":6201092,"name":"mpv","full_name":"mpv-player/mpv","owner":{"login":"mpv-player","id":2550273,"avatar_url":"https://avatars.githubusercontent.com/u/2550273?v=3","gravatar_id":"","url":"https://api.github.com/users/mpv-player","html_url":"https://github.com/mpv-player","followers_url":"https://api.github.com/users/mpv-player/followers","following_url":"https://api.github.com/users/mpv-player/following{/other_user}","gists_url":"https://api.github.com/users/mpv-player/gists{/gist_id}","starred_url":"https://api.github.com/users/mpv-player/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpv-player/subscriptions","organizations_url":"https://api.github.com/users/mpv-player/orgs","repos_url":"https://api.github.com/users/mpv-player/repos","events_url":"https://api.github.com/users/mpv-player/events{/privacy}","received_events_url":"https://api.github.com/users/mpv-player/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mpv-player/mpv","description":"Video player based on MPlayer/mplayer2","fork":false,"url":"https://api.github.com/repos/mpv-player/mpv","forks_url":"https://api.github.com/repos/mpv-player/mpv/forks","keys_url":"https://api.github.com/repos/mpv-player/mpv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mpv-player/mpv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mpv-player/mpv/teams","hooks_url":"https://api.github.com/repos/mpv-player/mpv/hooks","issue_events_url":"https://api.github.com/repos/mpv-player/mpv/issues/events{/number}","events_url":"https://api.github.com/repos/mpv-player/mpv/events","assignees_url":"https://api.github.com/repos/mpv-player/mpv/assignees{/user}","branches_url":"https://api.github.com/repos/mpv-player/mpv/branches{/branch}","tags_url":"https://api.github.com/repos/mpv-player/mpv/tags","blobs_url":"https://api.github.com/repos/mpv-player/mpv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mpv-player/mpv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mpv-player/mpv/git/refs{/sha}","trees_url":"https://api.github.com/repos/mpv-player/mpv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mpv-player/mpv/statuses/{sha}","languages_url":"https://api.github.com/repos/mpv-player/mpv/languages","stargazers_url":"https://api.github.com/repos/mpv-player/mpv/stargazers","contributors_url":"https://api.github.com/repos/mpv-player/mpv/contributors","subscribers_url":"https://api.github.com/repos/mpv-player/mpv/subscribers","subscription_url":"https://api.github.com/repos/mpv-player/mpv/subscription","commits_url":"https://api.github.com/repos/mpv-player/mpv/commits{/sha}","git_commits_url":"https://api.github.com/repos/mpv-player/mpv/git/commits{/sha}","comments_url":"https://api.github.com/repos/mpv-player/mpv/comments{/number}","issue_comment_url":"https://api.github.com/repos/mpv-player/mpv/issues/comments{/number}","contents_url":"https://api.github.com/repos/mpv-player/mpv/contents/{+path}","compare_url":"https://api.github.com/repos/mpv-player/mpv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mpv-player/mpv/merges","archive_url":"https://api.github.com/repos/mpv-player/mpv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mpv-player/mpv/downloads","issues_url":"https://api.github.com/repos/mpv-player/mpv/issues{/number}","pulls_url":"https://api.github.com/repos/mpv-player/mpv/pulls{/number}","milestones_url":"https://api.github.com/repos/mpv-player/mpv/milestones{/number}","notifications_url":"https://api.github.com/repos/mpv-player/mpv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mpv-player/mpv/labels{/name}","releases_url":"https://api.github.com/repos/mpv-player/mpv/releases{/id}","deployments_url":"https://api.github.com/repos/mpv-player/mpv/deployments","created_at":"2012-10-13T08:08:44Z","updated_at":"2016-02-17T14:55:22Z","pushed_at":"2016-02-17T14:39:54Z","git_url":"git://github.com/mpv-player/mpv.git","ssh_url":"git@github.com:mpv-player/mpv.git","clone_url":"https://github.com/mpv-player/mpv.git","svn_url":"https://github.com/mpv-player/mpv","homepage":"https://mpv.io","size":107671,"stargazers_count":3007,"watchers_count":3007,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":398,"mirror_url":null,"open_issues_count":233,"forks":398,"open_issues":233,"watchers":3007,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/2834"},"html":{"href":"https://github.com/mpv-player/mpv/pull/2834"},"issue":{"href":"https://api.github.com/repos/mpv-player/mpv/issues/2834"},"comments":{"href":"https://api.github.com/repos/mpv-player/mpv/issues/2834/comments"},"review_comments":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/2834/comments"},"review_comment":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mpv-player/mpv/pulls/2834/commits"},"statuses":{"href":"https://api.github.com/repos/mpv-player/mpv/statuses/63425a3013571044bf53627589d81122969537d4"}}}}