[latex3-commits] [latex3/latex3] l3sys-query: Expand spec/options arg. in sys query (da7d95636)
github at latex-project.org
github at latex-project.org
Wed Mar 13 21:21:35 CET 2024
Repository : https://github.com/latex3/latex3
On branch : l3sys-query
Link : https://github.com/latex3/latex3/commit/da7d95636a9d66bbb3d45cb4cbf2ae59dd6cd372
>---------------------------------------------------------------
commit da7d95636a9d66bbb3d45cb4cbf2ae59dd6cd372
Author: Joseph Wright <joseph at texdev.net>
Date: Wed Mar 13 20:21:35 2024 +0000
Expand spec/options arg. in sys query
>---------------------------------------------------------------
da7d95636a9d66bbb3d45cb4cbf2ae59dd6cd372
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.