summaryrefslogtreecommitdiffstats
path: root/txr.c
diff options
context:
space:
mode:
Diffstat (limited to 'txr.c')
-rw-r--r--txr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/txr.c b/txr.c
index 58bfffb3..dcf316ad 100644
--- a/txr.c
+++ b/txr.c
@@ -307,6 +307,9 @@ static int txr_main(int argc, char **argv)
if (specstring) {
spec_file = L"cmdline";
spec_file_str = string(spec_file);
+ if (gt(length_str(specstring), zero) &&
+ chr_str(specstring, minus(length_str(specstring), one)) != chr('\n'))
+ specstring = cat_str(list(specstring, string(L"\n"), nao), nil);
yyin_stream = make_string_byte_input_stream(specstring);
} else if (spec_file_str) {
if (wcscmp(c_str(spec_file_str), L"-") != 0) {