replace gettok by gettok_node to ignore parentheses when reading
a .model line in the altermod ... file ... command.
This commit is contained in:
parent
d6aa22e511
commit
ebf6cf0ecc
|
|
@ -1421,6 +1421,8 @@ com_alter_mod(wordlist *wl)
|
||||||
tfree(filename);
|
tfree(filename);
|
||||||
/* get all lines starting with *model */
|
/* get all lines starting with *model */
|
||||||
for (tmpdeck = modeldeck; tmpdeck; tmpdeck = tmpdeck->nextcard)
|
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 (ciprefix("*model", tmpdeck->line)) {
|
||||||
if (molineno == MODLIM) {
|
if (molineno == MODLIM) {
|
||||||
fprintf(cp_err, "Error: more than %d models in deck, rest ignored\n", molineno);
|
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);
|
tfree(inptoken);
|
||||||
inptoken = gettok(&modelline); /* skip model type */
|
inptoken = gettok(&modelline); /* skip model type */
|
||||||
tfree(inptoken);
|
tfree(inptoken);
|
||||||
while ((inptoken = gettok(&modelline)) != NULL) {
|
while ((inptoken = gettok_node(&modelline)) != NULL) {
|
||||||
/* exclude level, version and mfg */
|
/* exclude level, version and mfg */
|
||||||
if (ciprefix("version", inptoken) || ciprefix("level", inptoken) ||
|
if (ciprefix("version", inptoken) || ciprefix("level", inptoken) ||
|
||||||
ciprefix("mfg", inptoken)) {
|
ciprefix("mfg", inptoken)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue