{"action":"created","comment":{"url":"https://api.github.com/repos/solettaproject/soletta/pulls/comments/37892583","id":37892583,"diff_hunk":"@@ -952,12 +952,57 @@ handle_json_path(const char *path)\n         dup_path = sol_arena_strdup(str_arena, path);\n         SOL_NULL_CHECK(dup_path, false);\n \n-        sol_ptr_vector_append(&args.json_files, dup_path);\n+        if (sol_ptr_vector_append(&args.json_files, dup_path) < 0) {\n+            SOL_ERR(\"Couldn't handle json path '%s': %s\\n\", path, sol_util_strerrora(errno));\n+            return false;\n+        }\n+    }\n+\n+    return true;\n+}\n+\n+static bool\n+handle_include_path(char *path)\n+{\n+    struct stat s;\n+    char *dup_path;\n+\n+    if (stat(path, &s) != 0)\n+        return false;\n+\n+    if (S_ISDIR(s.st_mode))\n+        dup_path = sol_arena_strdup(str_arena, path);\n+    else if (S_ISREG(s.st_mode))\n+        dup_path = sol_arena_strdup(str_arena, dirname(path));\n+\n+    SOL_NULL_CHECK(dup_path, false);\n+    if (sol_ptr_vector_append(&args.include_paths, dup_path) < 0) {\n+        SOL_ERR(\"Couldn't handle include path '%s': %s\\n\", path, sol_util_strerrora(errno));\n+        return false;\n     }\n \n     return true;\n }\n \n+static bool\n+handle_include_dir(char *fullpath, const char *basename)\n+{\n+    struct stat s;\n+    const char *p;\n+    uint16_t i;\n+    int err;\n+\n+    SOL_PTR_VECTOR_FOREACH_IDX (&args.include_paths, p, i) {\n+        err = snprintf(fullpath, PATH_MAX, \"%s/%s\", p, basename);\n+        SOL_INT_CHECK(err, < 0, false);","path":"src/bin/sol-fbp-generator/main.c","position":57,"original_position":57,"commit_id":"6b5387ce4f7bfefbf1768f0e1b9f05ba867313b7","original_commit_id":"6b5387ce4f7bfefbf1768f0e1b9f05ba867313b7","user":{"login":"ricardotk","id":3178975,"avatar_url":"https://avatars.githubusercontent.com/u/3178975?v=3","gravatar_id":"","url":"https://api.github.com/users/ricardotk","html_url":"https://github.com/ricardotk","followers_url":"https://api.github.com/users/ricardotk/followers","following_url":"https://api.github.com/users/ricardotk/following{/other_user}","gists_url":"https://api.github.com/users/ricardotk/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardotk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardotk/subscriptions","organizations_url":"https://api.github.com/users/ricardotk/orgs","repos_url":"https://api.github.com/users/ricardotk/repos","events_url":"https://api.github.com/users/ricardotk/events{/privacy}","received_events_url":"https://api.github.com/users/ricardotk/received_events","type":"User","site_admin":false},"body":"You should check if the returned value is > fullpath as well.\r\ne.g. `if (len < 0 || len > (int)sizeof(fullpath))`","created_at":"2015-08-25T17:19:07Z","updated_at":"2015-08-25T17:19:07Z","html_url":"https://github.com/solettaproject/soletta/pull/625#discussion_r37892583","pull_request_url":"https://api.github.com/repos/solettaproject/soletta/pulls/625","_links":{"self":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/comments/37892583"},"html":{"href":"https://github.com/solettaproject/soletta/pull/625#discussion_r37892583"},"pull_request":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/625"}}},"pull_request":{"url":"https://api.github.com/repos/solettaproject/soletta/pulls/625","id":43307818,"html_url":"https://github.com/solettaproject/soletta/pull/625","diff_url":"https://github.com/solettaproject/soletta/pull/625.diff","patch_url":"https://github.com/solettaproject/soletta/pull/625.patch","issue_url":"https://api.github.com/repos/solettaproject/soletta/issues/625","number":625,"state":"open","locked":false,"title":"Add -I option to sol-fbp-generator","user":{"login":"lgywata","id":5435453,"avatar_url":"https://avatars.githubusercontent.com/u/5435453?v=3","gravatar_id":"","url":"https://api.github.com/users/lgywata","html_url":"https://github.com/lgywata","followers_url":"https://api.github.com/users/lgywata/followers","following_url":"https://api.github.com/users/lgywata/following{/other_user}","gists_url":"https://api.github.com/users/lgywata/gists{/gist_id}","starred_url":"https://api.github.com/users/lgywata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgywata/subscriptions","organizations_url":"https://api.github.com/users/lgywata/orgs","repos_url":"https://api.github.com/users/lgywata/repos","events_url":"https://api.github.com/users/lgywata/events{/privacy}","received_events_url":"https://api.github.com/users/lgywata/received_events","type":"User","site_admin":false},"body":"Now generator is able to search for fbp files according to paths\r\npassed to it through -I option.\r\n\r\nSigned-off-by: Luiz Ywata <luizg.ywata@intel.com>","created_at":"2015-08-25T16:34:50Z","updated_at":"2015-08-25T17:19:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2667696524676222c0ab9a15bc874ecb0c496d40","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/solettaproject/soletta/pulls/625/commits","review_comments_url":"https://api.github.com/repos/solettaproject/soletta/pulls/625/comments","review_comment_url":"https://api.github.com/repos/solettaproject/soletta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solettaproject/soletta/issues/625/comments","statuses_url":"https://api.github.com/repos/solettaproject/soletta/statuses/6b5387ce4f7bfefbf1768f0e1b9f05ba867313b7","head":{"label":"lgywata:include_v2","ref":"include_v2","sha":"6b5387ce4f7bfefbf1768f0e1b9f05ba867313b7","user":{"login":"lgywata","id":5435453,"avatar_url":"https://avatars.githubusercontent.com/u/5435453?v=3","gravatar_id":"","url":"https://api.github.com/users/lgywata","html_url":"https://github.com/lgywata","followers_url":"https://api.github.com/users/lgywata/followers","following_url":"https://api.github.com/users/lgywata/following{/other_user}","gists_url":"https://api.github.com/users/lgywata/gists{/gist_id}","starred_url":"https://api.github.com/users/lgywata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgywata/subscriptions","organizations_url":"https://api.github.com/users/lgywata/orgs","repos_url":"https://api.github.com/users/lgywata/repos","events_url":"https://api.github.com/users/lgywata/events{/privacy}","received_events_url":"https://api.github.com/users/lgywata/received_events","type":"User","site_admin":false},"repo":{"id":37605784,"name":"soletta","full_name":"lgywata/soletta","owner":{"login":"lgywata","id":5435453,"avatar_url":"https://avatars.githubusercontent.com/u/5435453?v=3","gravatar_id":"","url":"https://api.github.com/users/lgywata","html_url":"https://github.com/lgywata","followers_url":"https://api.github.com/users/lgywata/followers","following_url":"https://api.github.com/users/lgywata/following{/other_user}","gists_url":"https://api.github.com/users/lgywata/gists{/gist_id}","starred_url":"https://api.github.com/users/lgywata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lgywata/subscriptions","organizations_url":"https://api.github.com/users/lgywata/orgs","repos_url":"https://api.github.com/users/lgywata/repos","events_url":"https://api.github.com/users/lgywata/events{/privacy}","received_events_url":"https://api.github.com/users/lgywata/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lgywata/soletta","description":"Soletta Project is a framework for making IoT devices.  With Soletta Project's libraries developers can easily write software for devices that control actuators/sensors and communicate using standard technologies. It enables adding smartness even on the smallest edge devices.  Portable and scalable, it abstracts details of hardware and OS, enabling developers to reuse their code and knowledge on different targets.","fork":true,"url":"https://api.github.com/repos/lgywata/soletta","forks_url":"https://api.github.com/repos/lgywata/soletta/forks","keys_url":"https://api.github.com/repos/lgywata/soletta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lgywata/soletta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lgywata/soletta/teams","hooks_url":"https://api.github.com/repos/lgywata/soletta/hooks","issue_events_url":"https://api.github.com/repos/lgywata/soletta/issues/events{/number}","events_url":"https://api.github.com/repos/lgywata/soletta/events","assignees_url":"https://api.github.com/repos/lgywata/soletta/assignees{/user}","branches_url":"https://api.github.com/repos/lgywata/soletta/branches{/branch}","tags_url":"https://api.github.com/repos/lgywata/soletta/tags","blobs_url":"https://api.github.com/repos/lgywata/soletta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lgywata/soletta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lgywata/soletta/git/refs{/sha}","trees_url":"https://api.github.com/repos/lgywata/soletta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lgywata/soletta/statuses/{sha}","languages_url":"https://api.github.com/repos/lgywata/soletta/languages","stargazers_url":"https://api.github.com/repos/lgywata/soletta/stargazers","contributors_url":"https://api.github.com/repos/lgywata/soletta/contributors","subscribers_url":"https://api.github.com/repos/lgywata/soletta/subscribers","subscription_url":"https://api.github.com/repos/lgywata/soletta/subscription","commits_url":"https://api.github.com/repos/lgywata/soletta/commits{/sha}","git_commits_url":"https://api.github.com/repos/lgywata/soletta/git/commits{/sha}","comments_url":"https://api.github.com/repos/lgywata/soletta/comments{/number}","issue_comment_url":"https://api.github.com/repos/lgywata/soletta/issues/comments{/number}","contents_url":"https://api.github.com/repos/lgywata/soletta/contents/{+path}","compare_url":"https://api.github.com/repos/lgywata/soletta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lgywata/soletta/merges","archive_url":"https://api.github.com/repos/lgywata/soletta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lgywata/soletta/downloads","issues_url":"https://api.github.com/repos/lgywata/soletta/issues{/number}","pulls_url":"https://api.github.com/repos/lgywata/soletta/pulls{/number}","milestones_url":"https://api.github.com/repos/lgywata/soletta/milestones{/number}","notifications_url":"https://api.github.com/repos/lgywata/soletta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lgywata/soletta/labels{/name}","releases_url":"https://api.github.com/repos/lgywata/soletta/releases{/id}","created_at":"2015-06-17T16:07:53Z","updated_at":"2015-06-17T16:07:55Z","pushed_at":"2015-08-25T16:32:18Z","git_url":"git://github.com/lgywata/soletta.git","ssh_url":"git@github.com:lgywata/soletta.git","clone_url":"https://github.com/lgywata/soletta.git","svn_url":"https://github.com/lgywata/soletta","homepage":"","size":2624,"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":"solettaproject:master","ref":"master","sha":"719ef813eda593db30cf1e3684302e8af07e112c","user":{"login":"solettaproject","id":12736897,"avatar_url":"https://avatars.githubusercontent.com/u/12736897?v=3","gravatar_id":"","url":"https://api.github.com/users/solettaproject","html_url":"https://github.com/solettaproject","followers_url":"https://api.github.com/users/solettaproject/followers","following_url":"https://api.github.com/users/solettaproject/following{/other_user}","gists_url":"https://api.github.com/users/solettaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/solettaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solettaproject/subscriptions","organizations_url":"https://api.github.com/users/solettaproject/orgs","repos_url":"https://api.github.com/users/solettaproject/repos","events_url":"https://api.github.com/users/solettaproject/events{/privacy}","received_events_url":"https://api.github.com/users/solettaproject/received_events","type":"Organization","site_admin":false},"repo":{"id":37087063,"name":"soletta","full_name":"solettaproject/soletta","owner":{"login":"solettaproject","id":12736897,"avatar_url":"https://avatars.githubusercontent.com/u/12736897?v=3","gravatar_id":"","url":"https://api.github.com/users/solettaproject","html_url":"https://github.com/solettaproject","followers_url":"https://api.github.com/users/solettaproject/followers","following_url":"https://api.github.com/users/solettaproject/following{/other_user}","gists_url":"https://api.github.com/users/solettaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/solettaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solettaproject/subscriptions","organizations_url":"https://api.github.com/users/solettaproject/orgs","repos_url":"https://api.github.com/users/solettaproject/repos","events_url":"https://api.github.com/users/solettaproject/events{/privacy}","received_events_url":"https://api.github.com/users/solettaproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solettaproject/soletta","description":"Soletta Project is a framework for making IoT devices.  With Soletta Project's libraries developers can easily write software for devices that control actuators/sensors and communicate using standard technologies. It enables adding smartness even on the smallest edge devices.  ","fork":false,"url":"https://api.github.com/repos/solettaproject/soletta","forks_url":"https://api.github.com/repos/solettaproject/soletta/forks","keys_url":"https://api.github.com/repos/solettaproject/soletta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solettaproject/soletta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solettaproject/soletta/teams","hooks_url":"https://api.github.com/repos/solettaproject/soletta/hooks","issue_events_url":"https://api.github.com/repos/solettaproject/soletta/issues/events{/number}","events_url":"https://api.github.com/repos/solettaproject/soletta/events","assignees_url":"https://api.github.com/repos/solettaproject/soletta/assignees{/user}","branches_url":"https://api.github.com/repos/solettaproject/soletta/branches{/branch}","tags_url":"https://api.github.com/repos/solettaproject/soletta/tags","blobs_url":"https://api.github.com/repos/solettaproject/soletta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solettaproject/soletta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solettaproject/soletta/git/refs{/sha}","trees_url":"https://api.github.com/repos/solettaproject/soletta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solettaproject/soletta/statuses/{sha}","languages_url":"https://api.github.com/repos/solettaproject/soletta/languages","stargazers_url":"https://api.github.com/repos/solettaproject/soletta/stargazers","contributors_url":"https://api.github.com/repos/solettaproject/soletta/contributors","subscribers_url":"https://api.github.com/repos/solettaproject/soletta/subscribers","subscription_url":"https://api.github.com/repos/solettaproject/soletta/subscription","commits_url":"https://api.github.com/repos/solettaproject/soletta/commits{/sha}","git_commits_url":"https://api.github.com/repos/solettaproject/soletta/git/commits{/sha}","comments_url":"https://api.github.com/repos/solettaproject/soletta/comments{/number}","issue_comment_url":"https://api.github.com/repos/solettaproject/soletta/issues/comments{/number}","contents_url":"https://api.github.com/repos/solettaproject/soletta/contents/{+path}","compare_url":"https://api.github.com/repos/solettaproject/soletta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solettaproject/soletta/merges","archive_url":"https://api.github.com/repos/solettaproject/soletta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solettaproject/soletta/downloads","issues_url":"https://api.github.com/repos/solettaproject/soletta/issues{/number}","pulls_url":"https://api.github.com/repos/solettaproject/soletta/pulls{/number}","milestones_url":"https://api.github.com/repos/solettaproject/soletta/milestones{/number}","notifications_url":"https://api.github.com/repos/solettaproject/soletta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solettaproject/soletta/labels{/name}","releases_url":"https://api.github.com/repos/solettaproject/soletta/releases{/id}","created_at":"2015-06-08T19:13:18Z","updated_at":"2015-07-12T18:54:34Z","pushed_at":"2015-08-25T17:18:37Z","git_url":"git://github.com/solettaproject/soletta.git","ssh_url":"git@github.com:solettaproject/soletta.git","clone_url":"https://github.com/solettaproject/soletta.git","svn_url":"https://github.com/solettaproject/soletta","homepage":"","size":7687,"stargazers_count":39,"watchers_count":39,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":29,"forks":31,"open_issues":29,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/625"},"html":{"href":"https://github.com/solettaproject/soletta/pull/625"},"issue":{"href":"https://api.github.com/repos/solettaproject/soletta/issues/625"},"comments":{"href":"https://api.github.com/repos/solettaproject/soletta/issues/625/comments"},"review_comments":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/625/comments"},"review_comment":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solettaproject/soletta/pulls/625/commits"},"statuses":{"href":"https://api.github.com/repos/solettaproject/soletta/statuses/6b5387ce4f7bfefbf1768f0e1b9f05ba867313b7"}}}}