{"action":"created","comment":{"url":"https://api.github.com/repos/cfengine/core/pulls/comments/102259130","pull_request_review_id":23010698,"id":102259130,"diff_hunk":"@@ -0,0 +1,263 @@\n+#include <json-utils.h>\n+#include <logging.h>    // Log()\n+#include <file_lib.h>   // safe_fopen()\n+#include <string_lib.h> // TrimWhitespace()\n+#include <csv_parser.h>\n+#include <alloc.h>\n+#define CF_BUFSIZE 4096\n+\n+/**\n+ * @brief Filters a string, according to env file format\n+ *\n+ * This is used to parse the part after the equal sign in an env file\n+ * Leading and trailing whitespace should already be removed\n+ * Will terminate string after closing double quote, even when there's more\n+ *\n+ * @param src Copy from pointer, can be same as dst\n+ * @param dst Copy to pointer, can be same as src\n+ * @return beginning of processed string, either dst or dst + 1\n+ */\n+static char *filtered_copy(const char *src, char *dst)\n+{\n+    assert(src);\n+    assert(dst);\n+    char *beginning = dst;\n+    char opening_quote = '\\0';\n+    while (*src != '\\0')\n+    {\n+        if (*src == '\\\"' || *src == '\\'')\n+        {\n+            if (opening_quote == *src)\n+            {\n+                break;\n+            }\n+            else if (opening_quote == '\\0')\n+            {\n+                opening_quote = *src;\n+                ++src;\n+                if (*src == opening_quote)\n+                {\n+                    break;\n+                }\n+            }\n+        }\n+        if (*src == '\\\\')\n+        {\n+            ++src;","path":"libutils/json-utils.c","position":46,"original_position":46,"commit_id":"05ab20a015ba6427509eb51efa5e863254c48dff","original_commit_id":"05ab20a015ba6427509eb51efa5e863254c48dff","user":{"login":"olehermanse","id":4048546,"avatar_url":"https://avatars.githubusercontent.com/u/4048546?v=3","gravatar_id":"","url":"https://api.github.com/users/olehermanse","html_url":"https://github.com/olehermanse","followers_url":"https://api.github.com/users/olehermanse/followers","following_url":"https://api.github.com/users/olehermanse/following{/other_user}","gists_url":"https://api.github.com/users/olehermanse/gists{/gist_id}","starred_url":"https://api.github.com/users/olehermanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olehermanse/subscriptions","organizations_url":"https://api.github.com/users/olehermanse/orgs","repos_url":"https://api.github.com/users/olehermanse/repos","events_url":"https://api.github.com/users/olehermanse/events{/privacy}","received_events_url":"https://api.github.com/users/olehermanse/received_events","type":"User","site_admin":false},"body":"Added some notes on backslashes and what's supported","created_at":"2017-02-21T16:54:57Z","updated_at":"2017-02-21T16:54:57Z","html_url":"https://github.com/cfengine/core/pull/2791#discussion_r102259130","pull_request_url":"https://api.github.com/repos/cfengine/core/pulls/2791","_links":{"self":{"href":"https://api.github.com/repos/cfengine/core/pulls/comments/102259130"},"html":{"href":"https://github.com/cfengine/core/pull/2791#discussion_r102259130"},"pull_request":{"href":"https://api.github.com/repos/cfengine/core/pulls/2791"}}},"pull_request":{"url":"https://api.github.com/repos/cfengine/core/pulls/2791","id":104432948,"html_url":"https://github.com/cfengine/core/pull/2791","diff_url":"https://github.com/cfengine/core/pull/2791.diff","patch_url":"https://github.com/cfengine/core/pull/2791.patch","issue_url":"https://api.github.com/repos/cfengine/core/issues/2791","number":2791,"state":"open","locked":false,"title":"CFE-1881: ENV & CSV file parsing","user":{"login":"olehermanse","id":4048546,"avatar_url":"https://avatars.githubusercontent.com/u/4048546?v=3","gravatar_id":"","url":"https://api.github.com/users/olehermanse","html_url":"https://github.com/olehermanse","followers_url":"https://api.github.com/users/olehermanse/followers","following_url":"https://api.github.com/users/olehermanse/following{/other_user}","gists_url":"https://api.github.com/users/olehermanse/gists{/gist_id}","starred_url":"https://api.github.com/users/olehermanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olehermanse/subscriptions","organizations_url":"https://api.github.com/users/olehermanse/orgs","repos_url":"https://api.github.com/users/olehermanse/repos","events_url":"https://api.github.com/users/olehermanse/events{/privacy}","received_events_url":"https://api.github.com/users/olehermanse/received_events","type":"User","site_admin":false},"body":"Thanks to @tzz for #2624.","created_at":"2017-02-02T22:01:12Z","updated_at":"2017-02-21T16:54:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34022b4d8def924f0ebf569790bf6ff20530e445","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cfengine/core/pulls/2791/commits","review_comments_url":"https://api.github.com/repos/cfengine/core/pulls/2791/comments","review_comment_url":"https://api.github.com/repos/cfengine/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cfengine/core/issues/2791/comments","statuses_url":"https://api.github.com/repos/cfengine/core/statuses/05ab20a015ba6427509eb51efa5e863254c48dff","head":{"label":"olehermanse:olehermanse_tzz_os_release","ref":"olehermanse_tzz_os_release","sha":"05ab20a015ba6427509eb51efa5e863254c48dff","user":{"login":"olehermanse","id":4048546,"avatar_url":"https://avatars.githubusercontent.com/u/4048546?v=3","gravatar_id":"","url":"https://api.github.com/users/olehermanse","html_url":"https://github.com/olehermanse","followers_url":"https://api.github.com/users/olehermanse/followers","following_url":"https://api.github.com/users/olehermanse/following{/other_user}","gists_url":"https://api.github.com/users/olehermanse/gists{/gist_id}","starred_url":"https://api.github.com/users/olehermanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olehermanse/subscriptions","organizations_url":"https://api.github.com/users/olehermanse/orgs","repos_url":"https://api.github.com/users/olehermanse/repos","events_url":"https://api.github.com/users/olehermanse/events{/privacy}","received_events_url":"https://api.github.com/users/olehermanse/received_events","type":"User","site_admin":false},"repo":{"id":66275830,"name":"core","full_name":"olehermanse/core","owner":{"login":"olehermanse","id":4048546,"avatar_url":"https://avatars.githubusercontent.com/u/4048546?v=3","gravatar_id":"","url":"https://api.github.com/users/olehermanse","html_url":"https://github.com/olehermanse","followers_url":"https://api.github.com/users/olehermanse/followers","following_url":"https://api.github.com/users/olehermanse/following{/other_user}","gists_url":"https://api.github.com/users/olehermanse/gists{/gist_id}","starred_url":"https://api.github.com/users/olehermanse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olehermanse/subscriptions","organizations_url":"https://api.github.com/users/olehermanse/orgs","repos_url":"https://api.github.com/users/olehermanse/repos","events_url":"https://api.github.com/users/olehermanse/events{/privacy}","received_events_url":"https://api.github.com/users/olehermanse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/olehermanse/core","description":"CFEngine Community","fork":true,"url":"https://api.github.com/repos/olehermanse/core","forks_url":"https://api.github.com/repos/olehermanse/core/forks","keys_url":"https://api.github.com/repos/olehermanse/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/olehermanse/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/olehermanse/core/teams","hooks_url":"https://api.github.com/repos/olehermanse/core/hooks","issue_events_url":"https://api.github.com/repos/olehermanse/core/issues/events{/number}","events_url":"https://api.github.com/repos/olehermanse/core/events","assignees_url":"https://api.github.com/repos/olehermanse/core/assignees{/user}","branches_url":"https://api.github.com/repos/olehermanse/core/branches{/branch}","tags_url":"https://api.github.com/repos/olehermanse/core/tags","blobs_url":"https://api.github.com/repos/olehermanse/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/olehermanse/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/olehermanse/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/olehermanse/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/olehermanse/core/statuses/{sha}","languages_url":"https://api.github.com/repos/olehermanse/core/languages","stargazers_url":"https://api.github.com/repos/olehermanse/core/stargazers","contributors_url":"https://api.github.com/repos/olehermanse/core/contributors","subscribers_url":"https://api.github.com/repos/olehermanse/core/subscribers","subscription_url":"https://api.github.com/repos/olehermanse/core/subscription","commits_url":"https://api.github.com/repos/olehermanse/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/olehermanse/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/olehermanse/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/olehermanse/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/olehermanse/core/contents/{+path}","compare_url":"https://api.github.com/repos/olehermanse/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/olehermanse/core/merges","archive_url":"https://api.github.com/repos/olehermanse/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/olehermanse/core/downloads","issues_url":"https://api.github.com/repos/olehermanse/core/issues{/number}","pulls_url":"https://api.github.com/repos/olehermanse/core/pulls{/number}","milestones_url":"https://api.github.com/repos/olehermanse/core/milestones{/number}","notifications_url":"https://api.github.com/repos/olehermanse/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/olehermanse/core/labels{/name}","releases_url":"https://api.github.com/repos/olehermanse/core/releases{/id}","deployments_url":"https://api.github.com/repos/olehermanse/core/deployments","created_at":"2016-08-22T13:38:09Z","updated_at":"2016-10-26T21:37:48Z","pushed_at":"2017-02-16T17:55:12Z","git_url":"git://github.com/olehermanse/core.git","ssh_url":"git@github.com:olehermanse/core.git","clone_url":"https://github.com/olehermanse/core.git","svn_url":"https://github.com/olehermanse/core","homepage":"https://cfengine.com/community/","size":52905,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"olehermanse"}},"base":{"label":"cfengine:master","ref":"master","sha":"55a097ff3743e8a0c806a168545390007336f97e","user":{"login":"cfengine","id":1239823,"avatar_url":"https://avatars.githubusercontent.com/u/1239823?v=3","gravatar_id":"","url":"https://api.github.com/users/cfengine","html_url":"https://github.com/cfengine","followers_url":"https://api.github.com/users/cfengine/followers","following_url":"https://api.github.com/users/cfengine/following{/other_user}","gists_url":"https://api.github.com/users/cfengine/gists{/gist_id}","starred_url":"https://api.github.com/users/cfengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfengine/subscriptions","organizations_url":"https://api.github.com/users/cfengine/orgs","repos_url":"https://api.github.com/users/cfengine/repos","events_url":"https://api.github.com/users/cfengine/events{/privacy}","received_events_url":"https://api.github.com/users/cfengine/received_events","type":"Organization","site_admin":false},"repo":{"id":3543548,"name":"core","full_name":"cfengine/core","owner":{"login":"cfengine","id":1239823,"avatar_url":"https://avatars.githubusercontent.com/u/1239823?v=3","gravatar_id":"","url":"https://api.github.com/users/cfengine","html_url":"https://github.com/cfengine","followers_url":"https://api.github.com/users/cfengine/followers","following_url":"https://api.github.com/users/cfengine/following{/other_user}","gists_url":"https://api.github.com/users/cfengine/gists{/gist_id}","starred_url":"https://api.github.com/users/cfengine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfengine/subscriptions","organizations_url":"https://api.github.com/users/cfengine/orgs","repos_url":"https://api.github.com/users/cfengine/repos","events_url":"https://api.github.com/users/cfengine/events{/privacy}","received_events_url":"https://api.github.com/users/cfengine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cfengine/core","description":"CFEngine Community","fork":false,"url":"https://api.github.com/repos/cfengine/core","forks_url":"https://api.github.com/repos/cfengine/core/forks","keys_url":"https://api.github.com/repos/cfengine/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cfengine/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cfengine/core/teams","hooks_url":"https://api.github.com/repos/cfengine/core/hooks","issue_events_url":"https://api.github.com/repos/cfengine/core/issues/events{/number}","events_url":"https://api.github.com/repos/cfengine/core/events","assignees_url":"https://api.github.com/repos/cfengine/core/assignees{/user}","branches_url":"https://api.github.com/repos/cfengine/core/branches{/branch}","tags_url":"https://api.github.com/repos/cfengine/core/tags","blobs_url":"https://api.github.com/repos/cfengine/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cfengine/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cfengine/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/cfengine/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cfengine/core/statuses/{sha}","languages_url":"https://api.github.com/repos/cfengine/core/languages","stargazers_url":"https://api.github.com/repos/cfengine/core/stargazers","contributors_url":"https://api.github.com/repos/cfengine/core/contributors","subscribers_url":"https://api.github.com/repos/cfengine/core/subscribers","subscription_url":"https://api.github.com/repos/cfengine/core/subscription","commits_url":"https://api.github.com/repos/cfengine/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/cfengine/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/cfengine/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/cfengine/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/cfengine/core/contents/{+path}","compare_url":"https://api.github.com/repos/cfengine/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cfengine/core/merges","archive_url":"https://api.github.com/repos/cfengine/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cfengine/core/downloads","issues_url":"https://api.github.com/repos/cfengine/core/issues{/number}","pulls_url":"https://api.github.com/repos/cfengine/core/pulls{/number}","milestones_url":"https://api.github.com/repos/cfengine/core/milestones{/number}","notifications_url":"https://api.github.com/repos/cfengine/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cfengine/core/labels{/name}","releases_url":"https://api.github.com/repos/cfengine/core/releases{/id}","deployments_url":"https://api.github.com/repos/cfengine/core/deployments","created_at":"2012-02-25T09:19:05Z","updated_at":"2017-02-13T23:41:49Z","pushed_at":"2017-02-16T18:31:07Z","git_url":"git://github.com/cfengine/core.git","ssh_url":"git@github.com:cfengine/core.git","clone_url":"https://github.com/cfengine/core.git","svn_url":"https://github.com/cfengine/core","homepage":"https://cfengine.com/community/","size":53206,"stargazers_count":254,"watchers_count":254,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":158,"mirror_url":null,"open_issues_count":29,"forks":158,"open_issues":29,"watchers":254,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cfengine/core/pulls/2791"},"html":{"href":"https://github.com/cfengine/core/pull/2791"},"issue":{"href":"https://api.github.com/repos/cfengine/core/issues/2791"},"comments":{"href":"https://api.github.com/repos/cfengine/core/issues/2791/comments"},"review_comments":{"href":"https://api.github.com/repos/cfengine/core/pulls/2791/comments"},"review_comment":{"href":"https://api.github.com/repos/cfengine/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cfengine/core/pulls/2791/commits"},"statuses":{"href":"https://api.github.com/repos/cfengine/core/statuses/05ab20a015ba6427509eb51efa5e863254c48dff"}}}}
{"actor":{"display_login":"olehermanse"}}