add a warning if file with modified parameters has not been found.

Then ignore the altermod command.
This commit is contained in:
Holger Vogt 2020-04-13 10:26:05 +02:00
parent 4c80a1ab7d
commit 55f3776fc1
1 changed files with 8 additions and 0 deletions

View File

@ -1403,7 +1403,15 @@ com_alter_mod(wordlist *wl)
}
filename = copy(eqword);
}
modfile = inp_pathopen(filename, readmode);
if (modfile == NULL) {
fprintf(cp_err, "Warning: Could not open file %s, altermod ignored\n", filename);
tfree(input);
tfree(filename);
return;
}
{
char *dir_name = ngdirname(filename);
modeldeck = inp_readall(modfile, dir_name, 0, 0, NULL);