getexpress(), ls ==> ls_ptr - (const) s
This commit is contained in:
parent
f19ddf6090
commit
632829575b
|
|
@ -1340,16 +1340,17 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
returns tpe=='R' if (numeric, 'S' if (string only
|
returns tpe=='R' if (numeric, 'S' if (string only
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
const char *ls_ptr;
|
||||||
const char *iptr;
|
const char *iptr;
|
||||||
iptr = *pi - s + s;
|
iptr = *pi - s + s;
|
||||||
int ia, ls, level;
|
int ia, level;
|
||||||
char c, d;
|
char c, d;
|
||||||
nupa_type tpe;
|
nupa_type tpe;
|
||||||
|
|
||||||
ls = (int) strlen(s);
|
(ls_ptr - s) = (int) strlen(s);
|
||||||
ia = (int) (iptr - s) + 1;
|
ia = (int) (iptr - s) + 1;
|
||||||
|
|
||||||
while ((ia < ls) && (s[ia - 1] <= ' '))
|
while ((ia < (ls_ptr - s)) && (s[ia - 1] <= ' '))
|
||||||
ia++; /*white space ? */
|
ia++; /*white space ? */
|
||||||
|
|
||||||
if (s[ia - 1] == '"') {
|
if (s[ia - 1] == '"') {
|
||||||
|
|
@ -1357,14 +1358,14 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
ia++;
|
ia++;
|
||||||
iptr = ia + s;
|
iptr = ia + s;
|
||||||
|
|
||||||
while (((iptr - s) < ls) && (s[(iptr - s) - 1] != '"'))
|
while (((iptr - s) < (ls_ptr - s)) && (s[(iptr - s) - 1] != '"'))
|
||||||
iptr++;
|
iptr++;
|
||||||
|
|
||||||
tpe = NUPA_STRING;
|
tpe = NUPA_STRING;
|
||||||
|
|
||||||
do
|
do
|
||||||
iptr++;
|
iptr++;
|
||||||
while (((iptr - s) <= ls) && (s[(iptr - s) - 1] <= ' '));
|
while (((iptr - s) <= (ls_ptr - s)) && (s[(iptr - s) - 1] <= ' '));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
@ -1377,7 +1378,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
{
|
{
|
||||||
iptr++;
|
iptr++;
|
||||||
|
|
||||||
if ((iptr - s) > ls)
|
if ((iptr - s) > (ls_ptr - s))
|
||||||
c = ';';
|
c = ';';
|
||||||
else
|
else
|
||||||
c = s[(iptr - s) - 1];
|
c = s[(iptr - s) - 1];
|
||||||
|
|
@ -1389,7 +1390,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
{
|
{
|
||||||
iptr++;
|
iptr++;
|
||||||
|
|
||||||
if ((iptr - s) > ls)
|
if ((iptr - s) > (ls_ptr - s))
|
||||||
d = '\0';
|
d = '\0';
|
||||||
else
|
else
|
||||||
d = s[(iptr - s) - 1];
|
d = s[(iptr - s) - 1];
|
||||||
|
|
@ -1399,7 +1400,7 @@ getexpress(const char * const s, SPICE_DSTRINGPTR tstr_p, const char **pi)
|
||||||
else if (d == ')')
|
else if (d == ')')
|
||||||
level--;
|
level--;
|
||||||
|
|
||||||
} while (((iptr - s) <= ls) && !((d == ')') && (level <= 0)));
|
} while (((iptr - s) <= (ls_ptr - s)) && !((d == ')') && (level <= 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} while (!strchr(",;)}", c)); /* legal separators */
|
} while (!strchr(",;)}", c)); /* legal separators */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue