inpcom.c, introduce better skip_back functions
This commit is contained in:
parent
229385b439
commit
087cc1cb41
|
|
@ -115,6 +115,9 @@ static char *skip_back_ws(char *d) { while (isspace(d[-1])) d--; r
|
|||
static char *skip_non_ws(char *d) { while (*d && !isspace(*d)) d++; return d; }
|
||||
static char *skip_ws(char *d) { while (isspace(*d)) d++; return d; }
|
||||
|
||||
static char *skip_back_non_ws_(char *d, char *start) { while (d > start && !isspace(d[-1])) d--; return d; }
|
||||
static char *skip_back_ws_(char *d, char *start) { while (d > start && isspace(d[-1])) d--; return d; }
|
||||
|
||||
static void tprint(struct line *deck);
|
||||
|
||||
#ifndef XSPICE
|
||||
|
|
@ -3350,9 +3353,7 @@ get_param_name(char *line)
|
|||
|
||||
equal_ptr = skip_back_ws(equal_ptr);
|
||||
|
||||
beg = equal_ptr;
|
||||
while (beg > line && !isspace(beg[-1]))
|
||||
beg--;
|
||||
beg = skip_back_non_ws_(equal_ptr, line);
|
||||
|
||||
return copy_substring(beg, equal_ptr);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue