- data.min_fields = 3;+ data.min_fields = 5;
Please note that parse_file_line() returns if length(fields) is less
than data->min_fields. With the above change, anything with < 4 colons
will be rejected.
+ if (g_strv_length(fields) == data->min_fields)
N/A: parse_file_line() returns on length(fields) < min_fields, and the
maximum fields to parse are min_fields, so length(fields) is always
equal to min_fields at this point.
+ {
+ *type = g_strstrip(g_strdup(fields[data->line_idx+2]));
Errr, why do you assume that type is always at line_idx+2?..
--
Finally:
1. You wrote support for the fallback parser only, and not for regex.
2. This should be considered after either pull request #191 or SF
patch #11 is applied. If the PR is chosen, this patch should be fully
rewritten as capturing group <W> or something similar.