about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-16 09:59:10 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-16 09:59:10 -0700
commitaa7e1d0ffd243c123a67721304a6653d3cb5fa39 (patch)
treea0f1147069a214e483aa7592b777cc3bb5f95798
parent984a109050f3491e05dae1299cf3ecf35253ed49 (diff)
downloadmu-aa7e1d0ffd243c123a67721304a6653d3cb5fa39.tar.gz
4354
-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);