inpcom.c, improved method for detecting model names
This commit is contained in:
parent
00d88d28ce
commit
bcf0f3c76e
|
|
@ -1655,7 +1655,7 @@ get_subckt_model_name(char *line)
|
||||||
static char*
|
static char*
|
||||||
get_model_name(char *line, int num_terminals)
|
get_model_name(char *line, int num_terminals)
|
||||||
{
|
{
|
||||||
char *beg_ptr, *end_ptr;
|
char *beg_ptr, *end_ptr, *new_token;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
beg_ptr = skip_non_ws(line); /* eat device name */
|
beg_ptr = skip_non_ws(line); /* eat device name */
|
||||||
|
|
@ -1673,8 +1673,11 @@ get_model_name(char *line, int num_terminals)
|
||||||
}
|
}
|
||||||
|
|
||||||
end_ptr = skip_non_ws(beg_ptr);
|
end_ptr = skip_non_ws(beg_ptr);
|
||||||
|
/* check if an '=' sign is in the token -> not a model */
|
||||||
return copy_substring(beg_ptr, end_ptr);
|
new_token = copy_substring(beg_ptr, end_ptr);
|
||||||
|
if (strchr(new_token, '='))
|
||||||
|
new_token[0] = '\0';
|
||||||
|
return new_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1717,9 +1720,8 @@ get_adevice_model_name(char *line)
|
||||||
static int
|
static int
|
||||||
is_a_modelname(const char *s)
|
is_a_modelname(const char *s)
|
||||||
{
|
{
|
||||||
/* first character of model name is character from alphabet
|
/* first character of model name is character from alphabet */
|
||||||
* and second character is not '=', as in c=1e-12 */
|
if (isalpha_c(s[0]))
|
||||||
if (isalpha_c(s[0]) && s[1] != '=')
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* e.g. 1N4002, but do not accept floats (for example 1E2) */
|
/* e.g. 1N4002, but do not accept floats (for example 1E2) */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue