diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-06 16:34:30 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-06 16:34:30 -0800 |
commit | 2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0 (patch) | |
tree | 6493a6d6fcc6654a25570a1f623a0d2c7436dece /txr.c | |
parent | 3d38f312065003330f2f9c6f504f0e634ba2a5b6 (diff) | |
download | txr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.tar.gz txr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.tar.bz2 txr-2d9d9e5fb0fe70a195a74fd7a3f32f4ff5d22bf0.zip |
Throw exception on stream error during close, or I/O operations. This
is needed for pipes that terminate abnormally or return failed
termination. Pipe and stdio streams have an extra description field
so they are printed in a readable way.
Diffstat (limited to 'txr.c')
-rw-r--r-- | txr.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -309,7 +309,7 @@ static int txr_main(int argc, char **argv) FILE *in = fopen(c_str(spec_file_str), "r"); if (in == 0) uw_throwcf(file_error, "unable to open %s", c_str(spec_file_str)); - yyin_stream = make_stdio_stream(in, t, nil); + yyin_stream = make_stdio_stream(in, spec_file_str, t, nil); } else { spec_file = "stdin"; } @@ -323,7 +323,7 @@ static int txr_main(int argc, char **argv) FILE *in = fopen(*argv, "r"); if (in == 0) uw_throwcf(file_error, "unable to open %s", *argv); - yyin_stream = make_stdio_stream(in, t, nil); + yyin_stream = make_stdio_stream(in, string(*argv), t, nil); spec_file = *argv; } else { spec_file = "stdin"; |