[latex3-commits] [git/LaTeX3-latex3-latex3] master: Avoid \tl_to_str:n abuse by using the kernel function (9795117)

Bruno Le Floch bruno at le-floch.fr
Fri Apr 20 01:26:29 CEST 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/97951179aacda62361bff42387152a5787df2bc0

>---------------------------------------------------------------

commit 97951179aacda62361bff42387152a5787df2bc0
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Thu Apr 19 19:26:29 2018 -0400

    Avoid \tl_to_str:n abuse by using the kernel function


>---------------------------------------------------------------

97951179aacda62361bff42387152a5787df2bc0
 l3kernel/l3tl.dtx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/l3kernel/l3tl.dtx b/l3kernel/l3tl.dtx
index e95d76f..6689c5d 100644
--- a/l3kernel/l3tl.dtx
+++ b/l3kernel/l3tl.dtx
@@ -2100,15 +2100,14 @@
 %   |#1| has a single item, the token is~|^| and the catcode test
 %   yields \texttt{true}.  Otherwise, it is one of the characters
 %   resulting from \cs{tl_to_str:n}, and the catcode test yields
-%   \texttt{false}.  Note that \cs{if_catcode:w} takes care of the
-%   expansions, and that \cs{tl_to_str:n} (the \tn{detokenize}
-%   primitive) actually expands tokens until finding a begin-group
-%   token.
+%   \texttt{false}.  Note that \cs{if_catcode:w} and
+%   \cs{__kernel_tl_to_str:w} are primitives that take care of
+%   expansion.
 %    \begin{macrocode}
 \prg_new_conditional:Npnn \tl_if_single:n #1 { p , T , F , TF }
   {
     \if_catcode:w ^ \exp_after:wN \@@_if_single:nnw
-        \tl_to_str:n \exp_after:wN { \use_none:nn #1 ?? } ^ ? \q_stop
+        \__kernel_tl_to_str:w \exp_after:wN { \use_none:nn #1 ?? } ^ ? \q_stop
       \prg_return_true:
     \else:
       \prg_return_false:





More information about the latex3-commits mailing list