From bd50814677adbbf262a7afd326370094bc4ce2ee Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 30 Oct 2016 11:32:55 +0100 Subject: [PATCH] drop 'depreciated_skip..()' --- src/frontend/inpcom.c | 7 ++++--- src/include/ngspice/stringskip.h | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index a4478727d..180a5fd48 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -6166,14 +6166,15 @@ inp_quote_params(struct line *c, struct line *end_c, struct dependency *deps, in char *rest = s + strlen(deps[i].param_name); - if ((isspace_c(s[-1]) || s[-1] == '=') && + if (s > curr_line && + (isspace_c(s[-1]) || s[-1] == '=') && (isspace_c(*rest) || *rest == '\0' || *rest == ')')) { int prefix_len; if (isspace_c(s[-1])) { - s = depreciated_skip_back_ws(s); - if (s[-1] == '{') + s = skip_back_ws(s, curr_line); + if (s > curr_line && s[-1] == '{') s--; } diff --git a/src/include/ngspice/stringskip.h b/src/include/ngspice/stringskip.h index 7e3de7b4f..2e7840fe5 100644 --- a/src/include/ngspice/stringskip.h +++ b/src/include/ngspice/stringskip.h @@ -4,8 +4,6 @@ static inline char *skip_non_ws(const char *s) { while (*s && !isspace_c(*s)) s++; return (char *) s; } static inline char *skip_ws(const char *s) { while ( isspace_c(*s)) s++; return (char *) s; } -static inline char *depreciated_skip_back_non_ws(char *s) { while (s[-1] && !isspace_c(s[-1])) s--; return s; } -static inline char *depreciated_skip_back_ws(char *s) { while (isspace_c(s[-1])) s--; return s; } static inline char *skip_back_non_ws(const char *s, const char *start) { while (s > start && !isspace_c(s[-1])) s--; return (char *) s; } static inline char *skip_back_ws(const char *s, const char *start) { while (s > start && isspace_c(s[-1])) s--; return (char *) s; }