From 86e9de5b4e2143f925ae8c8e1852657e7e5c98a4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 5 Jul 2021 23:37:56 -0700 Subject: regex-compile: argument defaulting issue. * regex.c (regex_compile): In the string case when regex_parse needs to be called, redundant argument defaulting is being performed on error_stream, defaulting it to nil. The regex_parse function doesn't like that; it no longer accepts nil as a facsimile of missing. The right thing to do here is nothing: just pass error_stream to regex_parse as-is and let it do the defaulting. And that is how the code was initially until commit a8b0e36b1760e51a8a3a25d4e22a325e407ef3d4 in March of 2014, which introduced the redundant defaulting. Reported by Paul A. Patience --- regex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regex.c b/regex.c index 21e5cb7e..86857f01 100644 --- a/regex.c +++ b/regex.c @@ -2219,7 +2219,7 @@ val regex_compile(val regex_sexp, val error_stream) val regex_source; if (stringp(regex_sexp)) { - regex_sexp = regex_parse(regex_sexp, default_null_arg(error_stream)); + regex_sexp = regex_parse(regex_sexp, error_stream); return if2(regex_sexp, regex_compile(regex_sexp, error_stream)); } -- cgit v1.2.3