diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-10-14 12:54:46 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-10-14 12:54:46 +0000 |
| commit | b3b0926fe1bda80b8695f53d961902a9c3927c3e (patch) | |
| tree | 3465af0a9379829b0ef3f43bada6536a0603dffe | |
| parent | da0b76803d94e3f6b7548de6ae9933ac8dfcc685 (diff) | |
spit an error when no config file is found, to avoid confusing lex and the user.
| -rw-r--r-- | util/epist/parser.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/util/epist/parser.cc b/util/epist/parser.cc index 5c953aae..f6ed589e 100644 --- a/util/epist/parser.cc +++ b/util/epist/parser.cc @@ -54,9 +54,13 @@ void parser::parse(string rc_file) yyin = fopen(rc_file.c_str(), "r"); - yyparse(this); + if (yyin) { + yyparse(this); + fclose(yyin); + } else { + std::cerr << "ERROR: Configuration file could not be opened/found.\n"; + } - fclose(yyin); _kt->reset(); _kt->initialize(); } |
