summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-05-26 21:49:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-05-26 21:49:12 -0700
commitc8a8701a81abea8bfe98b6e04ca094c4dc1ff932 (patch)
treec5accc34f135107e1c3c730ef42986d9a4f058bc
parent9398dfe87384c395d683aca99576e30d53fd5dde (diff)
downloadtxr-c8a8701a81abea8bfe98b6e04ca094c4dc1ff932.tar.gz
txr-c8a8701a81abea8bfe98b6e04ca094c4dc1ff932.tar.bz2
txr-c8a8701a81abea8bfe98b6e04ca094c4dc1ff932.zip
open-file: show function name in bad modes diagnostic.
* stream.c (normalize_mode): Include the self symbol in the error message being thrown. This was not forgotten in the sister function normalize_mode_no_bin.
-rw-r--r--stream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/stream.c b/stream.c
index 621316e1..b5105b44 100644
--- a/stream.c
+++ b/stream.c
@@ -1634,7 +1634,8 @@ val normalize_mode(struct stdio_mode *m, val mode_str, struct stdio_mode m_dfl,
*m = do_parse_mode(mode_str, m_dfl, self);
if (m->malformed)
- uw_throwf(file_error_s, lit("invalid file open mode ~s"), mode_str, nao);
+ uw_throwf(file_error_s, lit("~a: invalid file open mode ~s"),
+ self, mode_str, nao);
return format_mode(*m);
}