summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-05 23:37:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-05 23:37:56 -0700
commit86e9de5b4e2143f925ae8c8e1852657e7e5c98a4 (patch)
tree53ad220971d974e1fbe0eadcc1d179a29f1cdbd3
parent462a21172c3adb8b9cfb59b21e8c472d7cb0b374 (diff)
downloadtxr-86e9de5b4e2143f925ae8c8e1852657e7e5c98a4.tar.gz
txr-86e9de5b4e2143f925ae8c8e1852657e7e5c98a4.tar.bz2
txr-86e9de5b4e2143f925ae8c8e1852657e7e5c98a4.zip
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
-rw-r--r--regex.c2
1 files changed, 1 insertions, 1 deletions
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));
}