[latex3-commits] [latex3/latex3] main: Expand spec/options arg. in sys query (21310ffe4)

github at latex-project.org github at latex-project.org
Thu Mar 14 08:06:58 CET 2024


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/21310ffe4a564952ff3a1fdf738b28e213aefca8

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

commit 21310ffe4a564952ff3a1fdf738b28e213aefca8
Author: Joseph Wright <joseph at texdev.net>
Date:   Wed Mar 13 20:21:35 2024 +0000

    Expand spec/options arg. in sys query


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

21310ffe4a564952ff3a1fdf738b28e213aefca8
 l3kernel/l3sys.dtx | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/l3kernel/l3sys.dtx b/l3kernel/l3sys.dtx
index c1e2f18e6..9bcba15ca 100644
--- a/l3kernel/l3sys.dtx
+++ b/l3kernel/l3sys.dtx
@@ -353,6 +353,9 @@
 %   \meta{options}, this will need to be protected from shell expansion
 %   using |'| tokens.
 %
+%   The \meta{spec} and \meta{options}, if given, are expanded fully
+%   before passing to the underlying script.
+%
 %   If more than one line of text is returned by the \meta{cmd}, these will be
 %   separated by character~13 (|^^M|) tokens of category code~12. In most
 %   cases, \cs{sys_split_query:nnnN} should be preferred when multi-line
@@ -1141,7 +1144,12 @@ end
 %
 % \begin{macro}{\sys_get_query:nN}
 % \begin{macro}{\sys_get_query:nnN}
-% \begin{macro}{\sys_get_query:nnnN, \@@_get_query:nnnN, \@@_get_query:neeN}
+% \begin{macro}
+%   {
+%     \sys_get_query:nnnN,
+%     \@@_get_query_auxi:nnnN, \@@_get_query_auxi:neeN,
+%     \@@_get_query_auxii:nnnN, \@@_get_query_auxii:neeN
+%   }
 %   Calling the query system is quite straight-forward: most of the effort is
 %   in making the read-back catcode-safe. We also want to trim off the trailing
 %   |^^M| from the last line.
@@ -1153,20 +1161,25 @@ end
 \cs_new_protected:Npn \sys_get_query:nnnN #1#2#3#4
   {
     \str_clear:N #4
-    \@@_get_query:neeN {#1}
-      { \tl_if_blank:nF {#2} { \exp_not:n { ~ #2 } } }
+    \@@_get_query_auxi:neeN {#1} {#2} {#3} #4
+  }
+\cs_new:Npn \@@_get_query_auxi:nnnN
+  {
+    \@@_get_query_auxii:neeN {#1}
+      { \tl_if_blank:nF {#2} { \tl_to_str:n { ~ #2 } } }
       {
         \tl_if_blank:nF {#3}
           {
             \c_space_tl
             \sys_if_shell_restricted:F '
-            \exp_not:n {#3}
+            \tl_to_str:n {#3}
             \sys_if_shell_restricted:F '
           }
       }
       #4
   }
-\cs_new_protected:Npn \@@_get_query:nnnN #1#2#3#4
+\cs_generate_variant:Nn \@@_get_query_auxi:nnnN { nee }
+\cs_new_protected:Npn \@@_get_query_auxii:nnnN #1#2#3#4
   {
     \sys_if_shell:T
       {
@@ -1187,7 +1200,7 @@ end
           }
       }
   }
-\cs_generate_variant:Nn \@@_get_query:nnnN { nee }
+\cs_generate_variant:Nn \@@_get_query_auxii:nnnN { nee }
 \group_begin:
   \tex_lccode:D `\* = 13 \scan_stop:
   \tex_lowercase:D





More information about the latex3-commits mailing list.