{"action":"created","comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/34457374","id":34457374,"diff_hunk":"@@ -162,12 +162,21 @@ bool is_river(const oter_id &ter)\n bool is_ot_type(const std::string &otype, const oter_id &oter)\n {\n     const size_t compare_size = otype.size();\n-    if (compare_size > oter.size()) {\n-        return false;\n-    } else {\n-        return std::string(oter).compare(0, compare_size, otype ) == 0;\n-    }\n \n+    if (compare_size <= oter.size()) {\n+        const auto oter_str = std::string(oter);\n+        if (oter_str.compare(0, compare_size, otype) == 0) {\n+            // check if it's a full match\n+            if (compare_size == oter.size()) {\n+                return true;\n+            }\n+            // only ok for partial if next char is an underscore\n+            if (oter_str.at(compare_size) == '_') {","path":"src/overmap.cpp","position":18,"original_position":18,"commit_id":"51f825d99c5fc048a59f9743fc381f0db307053d","original_commit_id":"51f825d99c5fc048a59f9743fc381f0db307053d","user":{"login":"narc0tiq","id":591573,"avatar_url":"https://avatars.githubusercontent.com/u/591573?v=3","gravatar_id":"","url":"https://api.github.com/users/narc0tiq","html_url":"https://github.com/narc0tiq","followers_url":"https://api.github.com/users/narc0tiq/followers","following_url":"https://api.github.com/users/narc0tiq/following{/other_user}","gists_url":"https://api.github.com/users/narc0tiq/gists{/gist_id}","starred_url":"https://api.github.com/users/narc0tiq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narc0tiq/subscriptions","organizations_url":"https://api.github.com/users/narc0tiq/orgs","repos_url":"https://api.github.com/users/narc0tiq/repos","events_url":"https://api.github.com/users/narc0tiq/events{/privacy}","received_events_url":"https://api.github.com/users/narc0tiq/received_events","type":"User","site_admin":false},"body":"Four lines above here (still within the diff context), there's a check for `compare_size == oter.size()`... although should that be `oter_str.size()`, maybe?\r\n\r\nEither way, if that exception gets raised, something *truly* exceptional has to have happened, because we wouldn't have gone into this branch if `compare_size` was too long, and we can't get here if `compare_size` is exactly the right length. Therefore, compare_size must be at least 1 smaller than `oter_str`'s length, so the next character must exist.","created_at":"2015-07-13T12:24:21Z","updated_at":"2015-07-13T12:24:21Z","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925#discussion_r34457374","pull_request_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925","_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments/34457374"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925#discussion_r34457374"},"pull_request":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925"}}},"pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925","id":39804753,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925.patch","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12925","number":12925,"state":"open","locked":false,"title":"More stringent matching with is_ot_type()","user":{"login":"drbig","id":1252899,"avatar_url":"https://avatars.githubusercontent.com/u/1252899?v=3","gravatar_id":"","url":"https://api.github.com/users/drbig","html_url":"https://github.com/drbig","followers_url":"https://api.github.com/users/drbig/followers","following_url":"https://api.github.com/users/drbig/following{/other_user}","gists_url":"https://api.github.com/users/drbig/gists{/gist_id}","starred_url":"https://api.github.com/users/drbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbig/subscriptions","organizations_url":"https://api.github.com/users/drbig/orgs","repos_url":"https://api.github.com/users/drbig/repos","events_url":"https://api.github.com/users/drbig/events{/privacy}","received_events_url":"https://api.github.com/users/drbig/received_events","type":"User","site_admin":false},"body":"Returns true either on full match or partial match where next character is an underscore.\r\n\r\nFixes #12912 (hopefully...).","created_at":"2015-07-13T12:07:34Z","updated_at":"2015-07-13T12:24:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b1cd8ef737e41478d918361bf28cc89a88477aa","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925/commits","review_comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925/comments","review_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12925/comments","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/51f825d99c5fc048a59f9743fc381f0db307053d","head":{"label":"drbig:is_ot_type-fix","ref":"is_ot_type-fix","sha":"51f825d99c5fc048a59f9743fc381f0db307053d","user":{"login":"drbig","id":1252899,"avatar_url":"https://avatars.githubusercontent.com/u/1252899?v=3","gravatar_id":"","url":"https://api.github.com/users/drbig","html_url":"https://github.com/drbig","followers_url":"https://api.github.com/users/drbig/followers","following_url":"https://api.github.com/users/drbig/following{/other_user}","gists_url":"https://api.github.com/users/drbig/gists{/gist_id}","starred_url":"https://api.github.com/users/drbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbig/subscriptions","organizations_url":"https://api.github.com/users/drbig/orgs","repos_url":"https://api.github.com/users/drbig/repos","events_url":"https://api.github.com/users/drbig/events{/privacy}","received_events_url":"https://api.github.com/users/drbig/received_events","type":"User","site_admin":false},"repo":{"id":24682768,"name":"Cataclysm-DDA","full_name":"drbig/Cataclysm-DDA","owner":{"login":"drbig","id":1252899,"avatar_url":"https://avatars.githubusercontent.com/u/1252899?v=3","gravatar_id":"","url":"https://api.github.com/users/drbig","html_url":"https://github.com/drbig","followers_url":"https://api.github.com/users/drbig/followers","following_url":"https://api.github.com/users/drbig/following{/other_user}","gists_url":"https://api.github.com/users/drbig/gists{/gist_id}","starred_url":"https://api.github.com/users/drbig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drbig/subscriptions","organizations_url":"https://api.github.com/users/drbig/orgs","repos_url":"https://api.github.com/users/drbig/repos","events_url":"https://api.github.com/users/drbig/events{/privacy}","received_events_url":"https://api.github.com/users/drbig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drbig/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":true,"url":"https://api.github.com/repos/drbig/Cataclysm-DDA","forks_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/drbig/Cataclysm-DDA/releases{/id}","created_at":"2014-10-01T15:01:33Z","updated_at":"2015-04-02T18:35:11Z","pushed_at":"2015-07-13T12:05:53Z","git_url":"git://github.com/drbig/Cataclysm-DDA.git","ssh_url":"git@github.com:drbig/Cataclysm-DDA.git","clone_url":"https://github.com/drbig/Cataclysm-DDA.git","svn_url":"https://github.com/drbig/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":483026,"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":"CleverRaven:master","ref":"master","sha":"a1dfe6d23ea397753ac1440f90330d19805921a8","user":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"repo":{"id":5973855,"name":"Cataclysm-DDA","full_name":"CleverRaven/Cataclysm-DDA","owner":{"login":"CleverRaven","id":4367009,"avatar_url":"https://avatars.githubusercontent.com/u/4367009?v=3","gravatar_id":"","url":"https://api.github.com/users/CleverRaven","html_url":"https://github.com/CleverRaven","followers_url":"https://api.github.com/users/CleverRaven/followers","following_url":"https://api.github.com/users/CleverRaven/following{/other_user}","gists_url":"https://api.github.com/users/CleverRaven/gists{/gist_id}","starred_url":"https://api.github.com/users/CleverRaven/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CleverRaven/subscriptions","organizations_url":"https://api.github.com/users/CleverRaven/orgs","repos_url":"https://api.github.com/users/CleverRaven/repos","events_url":"https://api.github.com/users/CleverRaven/events{/privacy}","received_events_url":"https://api.github.com/users/CleverRaven/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CleverRaven/Cataclysm-DDA","description":"Cataclysm - Dark Days Ahead. A fork/variant of Cataclysm Roguelike by Whales.","fork":false,"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","forks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/forks","keys_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/teams","hooks_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/hooks","issue_events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/events{/number}","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/events","assignees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/assignees{/user}","branches_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/branches{/branch}","tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/tags","blobs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/refs{/sha}","trees_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/{sha}","languages_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/languages","stargazers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/stargazers","contributors_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contributors","subscribers_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscribers","subscription_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/subscription","commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/commits{/sha}","git_commits_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/git/commits{/sha}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/comments{/number}","issue_comment_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments{/number}","contents_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/contents/{+path}","compare_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/merges","archive_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/downloads","issues_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues{/number}","pulls_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls{/number}","milestones_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/milestones{/number}","notifications_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/labels{/name}","releases_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/releases{/id}","created_at":"2012-09-26T22:57:43Z","updated_at":"2015-07-11T09:12:31Z","pushed_at":"2015-07-13T12:07:35Z","git_url":"git://github.com/CleverRaven/Cataclysm-DDA.git","ssh_url":"git@github.com:CleverRaven/Cataclysm-DDA.git","clone_url":"https://github.com/CleverRaven/Cataclysm-DDA.git","svn_url":"https://github.com/CleverRaven/Cataclysm-DDA","homepage":"http://en.cataclysmdda.com/","size":567204,"stargazers_count":695,"watchers_count":695,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":733,"mirror_url":null,"open_issues_count":1012,"forks":733,"open_issues":1012,"watchers":695,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925"},"html":{"href":"https://github.com/CleverRaven/Cataclysm-DDA/pull/12925"},"issue":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12925"},"comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/12925/comments"},"review_comments":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925/comments"},"review_comment":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/12925/commits"},"statuses":{"href":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/statuses/51f825d99c5fc048a59f9743fc381f0db307053d"}}}}