From 7479e48f7aff63241c32786cc3654dfba6f4b878 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 5 Oct 2015 20:47:36 +0200 Subject: [PATCH] `E..value=', `G..value=', allow `=' being optional --- src/frontend/inpcom.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 8fbbeacd3..ec948115d 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -4229,12 +4229,10 @@ inp_compat(struct line *card) /* Exxx n1 n2 value={equation} --> Exxx n1 n2 vol={equation} */ - if ((str_ptr = strstr(curr_line, "value=")) != NULL) { - str_ptr[0] = ' '; - str_ptr[1] = ' '; - str_ptr[2] = 'v'; - str_ptr[3] = 'o'; - str_ptr[4] = 'l'; + if ((str_ptr = search_plain_identifier(curr_line, "value")) != NULL) { + if (str_ptr[5] == '=') + *str_ptr++ = ' '; + strncpy(str_ptr, " vol=", 5); } /* Exxx n1 n2 TABLE {expression} = (x0, y0) (x1, y1) (x2, y2) --> @@ -4405,12 +4403,10 @@ inp_compat(struct line *card) /* Gxxx n1 n2 value={equation} --> Gxxx n1 n2 cur={equation} */ - if ((str_ptr = strstr(curr_line, "value=")) != NULL) { - str_ptr[0] = ' '; - str_ptr[1] = ' '; - str_ptr[2] = 'c'; - str_ptr[3] = 'u'; - str_ptr[4] = 'r'; + if ((str_ptr = search_plain_identifier(curr_line, "value")) != NULL) { + if (str_ptr[5] == '=') + *str_ptr++ = ' '; + strncpy(str_ptr, " cur=", 5); } /* Gxxx n1 n2 TABLE {expression} = (x0, y0) (x1, y1) (x2, y2)