diff options
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 49 |
1 files changed, 0 insertions, 49 deletions
@@ -280,55 +280,6 @@ int parse_comment_reply(void *ctx, void *ret, const keyword *key, keyword_val va return 1; } -int parse_key_value_file(void *ret, void *ctx, const keyword **keywords, char *buf, const char *delm, parse_callback *parse_cb) { - if (buf != NULL) { - int ret_val = 0; - for (;;) { - char *lhs, *rhs; - /* Find the keyword before the delimiter(s). */ - lhs = strtok_r(skip_whitespace(buf), delm, &buf); - /* Remove any whitespace ahead of us. */ - lhs = strtok_r(lhs, " \t\v\r\n", &rhs); - - /* Did we hit EOF? */ - if (is_empty(lhs) || is_empty(buf)) { - break; - } else { - int error; - char *tmp = skip_whitespace(buf); - - /* Does the right hand side start with a double, or single quote? */ - if (*tmp == '\"' || *tmp == '\'') { - const char *delm = (*delm == '\"') ? "\"" : "\'"; - /* Get the string in between the start, and end qoute. */ - rhs = get_str_delm_range(tmp, delm, delm, &buf); - } else { - /* Get the rest of the line. */ - rhs = strtok_r(tmp, "\n", &buf); - } - - /* Did we fail to parse the keyword? */ - if (error = parse_keywords(keywords, lhs, rhs, ret, ctx)) { - log(LOG_WARNING, "Failed to parse keyword \"%s\". Error code: %i", lhs, error); - ret_val = error; - } - } - - /* Do we have a parse callback? */ - if (parse_cb != NULL) { - /* Did the callback return an error. */ - if (parse_cb(&ret, ctx, buf) < 0) { - ret_val = 7; - break; - } - } - } - return ret_val; - } else { - return 8; - } -} - static int is_end_of_comment(void **ret, void *ctx, char *buf) { /* Do we have at least one blank line? */ if (strspn(buf, "\n") >= 1) { |