about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--subx/021translate.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/subx/021translate.cc b/subx/021translate.cc
index f9da5f19..4cecb030 100644
--- a/subx/021translate.cc
+++ b/subx/021translate.cc
@@ -12,6 +12,10 @@ if (is_equal(argv[1], "translate")) {
   assert(argc > 3);
   program p;
   ifstream fin(argv[2]);
+  if (!fin) {
+    cerr << "could not open " << argv[2] << '\n';
+    return 1;
+  }
   parse(fin, p);
   if (trace_contains_errors()) return 1;
   transform(p);