replace gettok by gettok_node to ignore parentheses when reading

a .model line in the altermod ... file ... command.
This commit is contained in:
Holger Vogt 2020-09-09 20:23:30 +02:00
parent 110a853ce5
commit 990d87bf1c
1 changed files with 3 additions and 1 deletions

View File

@ -1421,6 +1421,8 @@ com_alter_mod(wordlist *wl)
tfree(filename);
/* get all lines starting with *model */
for (tmpdeck = modeldeck; tmpdeck; tmpdeck = tmpdeck->nextcard)
/* We are looking for *model because the input paerser has
invalidated all unused models by replacing '.' by '*'. */
if (ciprefix("*model", tmpdeck->line)) {
if (molineno == MODLIM) {
fprintf(cp_err, "Error: more than %d models in deck, rest ignored\n", molineno);
@ -1471,7 +1473,7 @@ com_alter_mod(wordlist *wl)
tfree(inptoken);
inptoken = gettok(&modelline); /* skip model type */
tfree(inptoken);
while ((inptoken = gettok(&modelline)) != NULL) {
while ((inptoken = gettok_node(&modelline)) != NULL) {
/* exclude level, version and mfg */
if (ciprefix("version", inptoken) || ciprefix("level", inptoken) ||
ciprefix("mfg", inptoken)) {