mirror of
https://github.com/clearlinux/telemetrics-client.git
synced 2026-09-01 11:15:51 +00:00
oops parser: add/use skip_space; fix skip_spaces
The former skip_spaces() function only skipped a single space, so rename it to skip_space(), and make skip_spaces() greedily consume spaces. Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
committed by
Robert Nesius
parent
3d24527096
commit
266039a4e5
@@ -184,7 +184,7 @@ char *skip_timestamp(char *line)
|
||||
return start;
|
||||
}
|
||||
|
||||
char *skip_spaces(char *line)
|
||||
char *skip_space(char *line)
|
||||
{
|
||||
char *start = line;
|
||||
|
||||
@@ -194,6 +194,16 @@ char *skip_spaces(char *line)
|
||||
return start;
|
||||
}
|
||||
|
||||
char *skip_spaces(char *line)
|
||||
{
|
||||
char *start = line;
|
||||
|
||||
while (*start && isspace(*start)) {
|
||||
start++;
|
||||
}
|
||||
return start;
|
||||
}
|
||||
|
||||
bool starts_with(const char *line, const char *line_end, const char *substr)
|
||||
{
|
||||
size_t substrlen = strlen(substr);
|
||||
@@ -346,7 +356,7 @@ void parse_single_line(char *line, size_t size)
|
||||
line_end = line + size;
|
||||
start = skip_log_level(line);
|
||||
start = skip_timestamp(start);
|
||||
start = skip_spaces(start);
|
||||
start = skip_space(start);
|
||||
|
||||
struct oops_pattern *pattern;
|
||||
if (oops_msg.length == 0) {
|
||||
|
||||
Reference in New Issue
Block a user