diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-09 13:10:27 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-09 13:11:45 -0700 |
commit | 412139f1be7415791a0d964f95f319c86eded426 (patch) | |
tree | f6f2326b39ea44a93004df25ba98ab210246860f /src/chartab.c | |
parent | ce59b41a28aba629dd126e7af3c6e45909de6a83 (diff) | |
download | emacs-412139f1be7415791a0d964f95f319c86eded426.tar.gz |
Do not alter match data in Fcapitalize etc.
Without this patch, (capitalize "x") can alter the match data,
which is not what users expect. Problem found by running
morse-tests-unnato-region in a stripped-down Emacs.
Perhaps ‘load’ should also save and restore the match data?
That would be a simpler fix, though arguably incompatible.
* src/lread.c (save_match_data_load): New function.
* src/chartab.c (uniprop_table):
* src/doc.c (reread_doc_file):
* src/eval.c (Fautoload_do_load):
* src/fns.c (Frequire): Use it.
Diffstat (limited to 'src/chartab.c')
-rw-r--r-- | src/chartab.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/chartab.c b/src/chartab.c index bf8e34b2529..04205ac1032 100644 --- a/src/chartab.c +++ b/src/chartab.c @@ -1288,7 +1288,7 @@ uniprop_table (Lisp_Object prop) if (STRINGP (table)) { AUTO_STRING (intl, "international/"); - result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt); + result = save_match_data_load (concat2 (intl, table), Qt, Qt, Qt, Qt); if (NILP (result)) return Qnil; table = XCDR (val); |