update to model search function

This commit is contained in:
Holger Vogt 2018-11-01 21:17:36 +01:00
parent 2497a0b157
commit 277842f948
1 changed files with 6 additions and 1 deletions

View File

@ -1816,6 +1816,7 @@ static int
is_a_modelname(const char *s)
{
char *st;
double testval;
/* first character of model name is character from alphabet */
if (isalpha_c(s[0]))
return TRUE;
@ -1823,7 +1824,11 @@ is_a_modelname(const char *s)
if (strchr("{*^@\\\'", s[0]))
return FALSE;
/* 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 */
if (*st == '\0' || isspace(*st))
return FALSE;