update to model search function
This commit is contained in:
parent
2497a0b157
commit
277842f948
|
|
@ -1816,6 +1816,7 @@ static int
|
||||||
is_a_modelname(const char *s)
|
is_a_modelname(const char *s)
|
||||||
{
|
{
|
||||||
char *st;
|
char *st;
|
||||||
|
double testval;
|
||||||
/* first character of model name is character from alphabet */
|
/* first character of model name is character from alphabet */
|
||||||
if (isalpha_c(s[0]))
|
if (isalpha_c(s[0]))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
@ -1823,7 +1824,11 @@ is_a_modelname(const char *s)
|
||||||
if (strchr("{*^@\\\'", s[0]))
|
if (strchr("{*^@\\\'", s[0]))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
/* not beeing a valid number */
|
/* not beeing a valid number */
|
||||||
if (strtod(s, &st))
|
testval = strtod(s, &st);
|
||||||
|
/* conversion failed, so no number */
|
||||||
|
if (eq(s, st))
|
||||||
|
return TRUE;
|
||||||
|
else
|
||||||
/* test if we have a true number */
|
/* test if we have a true number */
|
||||||
if (*st == '\0' || isspace(*st))
|
if (*st == '\0' || isspace(*st))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue