*** empty log message ***
This commit is contained in:
parent
260217c8ab
commit
331f389cc6
1 changed files with 12 additions and 17 deletions
29
parse.cc
29
parse.cc
|
|
@ -16,25 +16,20 @@ static inline char * skip_ws(char * ptr)
|
||||||
|
|
||||||
static inline char * next_element(char * buf, bool variable = false)
|
static inline char * next_element(char * buf, bool variable = false)
|
||||||
{
|
{
|
||||||
char * p;
|
for (char * p = buf; *p; p++) {
|
||||||
|
if (! (*p == ' ' || *p == '\t'))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (variable) {
|
if (! variable) {
|
||||||
// Convert any tabs to spaces, for simplicity's sake
|
*p = '\0';
|
||||||
for (p = buf; *p; p++)
|
return skip_ws(p + 1);
|
||||||
if (*p == '\t')
|
}
|
||||||
*p = ' ';
|
else if (*(p + 1) == ' ' || *(p + 1) == '\t') {
|
||||||
|
*p = '\0';
|
||||||
p = std::strstr(buf, " ");
|
return skip_ws(p + 2);
|
||||||
} else {
|
}
|
||||||
p = std::strchr(buf, ' ');
|
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
if (! p)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
*p++ = '\0';
|
|
||||||
|
|
||||||
return skip_ws(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *formats[] = {
|
static const char *formats[] = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue