diff --git a/src/frontend/com_let.c b/src/frontend/com_let.c index caa9df120..5ef19204b 100644 --- a/src/frontend/com_let.c +++ b/src/frontend/com_let.c @@ -112,8 +112,7 @@ com_let(wordlist *wl) vec_free(t); free_pnode(names); /* frees also t, if pnode `names' is simple value */ - s = q; - s = skip_ws(s); + s = skip_ws(q); } } /* vector name at p */ diff --git a/src/frontend/dimens.c b/src/frontend/dimens.c index e5e854d85..ad96b535d 100644 --- a/src/frontend/dimens.c +++ b/src/frontend/dimens.c @@ -136,8 +136,7 @@ atodims(char *p, int *data, int *outlength) p = skip_ws(p); if (*p == '[') { - p++; - p = skip_ws(p); + p = skip_ws(p + 1); needbracket = 1; } diff --git a/src/frontend/help/textdisp.c b/src/frontend/help/textdisp.c index 3db5835cd..a7b763a0a 100644 --- a/src/frontend/help/textdisp.c +++ b/src/frontend/help/textdisp.c @@ -73,8 +73,7 @@ hlp_thandle(topic **parent) return (NULL); } - s = buf; - s = skip_ws(s); + s = skip_ws(buf); switch (*s) { case '?': fprintf(cp_out, diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 8f99bee52..8bad1a3b1 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -395,16 +395,14 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) for (dd = deck->li_next; dd; dd = ld->li_next) { /* get temp from deck */ if (ciprefix(".temp", dd->li_line)) { - s = dd->li_line + 5; - s = skip_ws(s); + s = skip_ws(dd->li_line + 5); if (temperature) txfree(temperature); temperature = strdup(s); } /* Ignore comment lines, but not lines begining with '*#', but remove them, if they are in a .control ... .endc section */ - s = dd->li_line; - s = skip_ws(s); + s = skip_ws(dd->li_line); if ((*s == '*') && ((s != dd->li_line) || (s[1] != '#'))) { if (commands) { /* Remove comment lines in control sections, so they don't @@ -419,10 +417,8 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) /* Put the first token from line into s */ strncpy(name, dd->li_line, BSIZE_SP); - s = name; - s = skip_ws(s); - t = s; - t = skip_non_ws(t); + s = skip_ws(name); + t = skip_non_ws(s); *t = '\0'; if (ciprefix(".control", dd->li_line)) { @@ -563,10 +559,8 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile) wordlist *wlist = NULL; char *cstoken[3]; int i; - s = dd->li_line; - *s = '*'; - s = dd->li_line + 8; - s = skip_ws(s); + dd->li_line[0] = '*'; + s = skip_ws(dd->li_line + 8); cstoken[0] = gettok_char(&s, '=', FALSE, FALSE); cstoken[1] = gettok_char(&s, '=', TRUE, FALSE); cstoken[2] = gettok(&s); @@ -805,8 +799,7 @@ inp_dodeck( if (!noparse) { struct line *opt_beg = options; for (; options; options = options->li_next) { - s = options->li_line; - s = skip_non_ws(s); + s = skip_non_ws(options->li_line); ii = cp_interactive; cp_interactive = FALSE; @@ -986,8 +979,7 @@ inp_dodeck( if (!noparse) { /* * for (; options; options = options->li_next) { - * s = options->li_line; - * s = skip_non_ws(s); + * s = skip_non_ws(options->li_line); * ii = cp_interactive; * cp_interactive = FALSE; * wl = cp_lexer(s); diff --git a/src/frontend/numparam/spicenum.c b/src/frontend/numparam/spicenum.c index 3c2f94da7..ae73e85d7 100644 --- a/src/frontend/numparam/spicenum.c +++ b/src/frontend/numparam/spicenum.c @@ -831,8 +831,7 @@ nupa_eval(char *s, int linenum, int orig_linenum) err = nupa_substitute(dicoS, dicoS->dynrefptr[linenum], s, 0); } else if (c == 'X') { /* compute args of subcircuit, if required */ - ptr = s; - ptr = skip_non_ws(ptr); + ptr = skip_non_ws(s); keep = *ptr; *ptr = '\0'; nupa_inst_name = strdup(s); diff --git a/src/frontend/nutinp.c b/src/frontend/nutinp.c index 6100e1355..7e37b5384 100644 --- a/src/frontend/nutinp.c +++ b/src/frontend/nutinp.c @@ -94,10 +94,8 @@ inp_nutsource(FILE *fp, bool comfile, char *filename) continue; } (void) strncpy(name, dd->li_line, BSIZE_SP); - s = name; - s = skip_ws(s); - t = s; - t = skip_non_ws(t); + s = skip_ws(name); + t = skip_non_ws(s); *t = '\0'; if (ciprefix(".control", dd->li_line)) { diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 52672caa1..9d03a83f8 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -152,10 +152,9 @@ collect_global_nodes(struct line *c) char *s = c->li_line; txfree(gettok(&s)); while (*s) { - char *t = s; - s = skip_non_ws(s); - global_nodes[num_global_nodes++] = copy_substring(t, s); - s = skip_ws(s); + char *t = skip_non_ws(s); + global_nodes[num_global_nodes++] = copy_substring(s, t); + s = skip_ws(t); } c->li_line[0] = '*'; /* comment it out */ } @@ -1309,8 +1308,7 @@ finishLine(struct bxx_buffer *t, char *src, char *scname) bxx_putc(t, *src++); continue; } - s = src + 1; - s = skip_ws(s); + s = skip_ws(src + 1); if (!*s || (*s != '(')) { lastwasalpha = isalpha_c(*src); bxx_putc(t, *src++); diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 8ba9dc9ca..4069b065a 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -938,9 +938,7 @@ vec_basename(struct dvec *v) } strtolower(buf); - t = buf; - t = skip_ws(t); - s = t; + s = skip_ws(buf); for (t = s; *t; t++) ; while ((t > s) && isspace_c(t[-1])) diff --git a/src/misc/string.c b/src/misc/string.c index 4d839c904..c95a43413 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -663,8 +663,7 @@ get_comma_separated_values( char *values[], char *str ) { ptr++; keep = *ptr; *ptr = '\0'; values[count++] = strdup(str); *ptr = keep; - str = comma_ptr + 1; - str = skip_ws(str); + str = skip_ws(comma_ptr + 1); } values[count++] = strdup(str); return count; diff --git a/src/spicelib/parser/inp2r.c b/src/spicelib/parser/inp2r.c index 3800fa077..4659f1f76 100644 --- a/src/spicelib/parser/inp2r.c +++ b/src/spicelib/parser/inp2r.c @@ -83,19 +83,13 @@ void INP2R(CKTcircuit *ckt, INPtables * tab, card * current) char *p; size_t left_length; - s += 2; - - /* skip any white space */ - s = skip_ws(s); + s = skip_ws(s + 2); /* reject if not '=' */ if(*s != '=') continue; - s++; - - /* skip any white space */ - s = skip_ws(s); + s = skip_ws(s + 1); /* if we now have +, - or a decimal digit then assume we have a number, otherwise reject */