[latex3-commits] [git/LaTeX3-latex3-latex3] master: Further work on file names (096dcaa87)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Oct 24 17:30:58 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/096dcaa87f72ec95d69d2c43bf05f02b3e453bfd

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

commit 096dcaa87f72ec95d69d2c43bf05f02b3e453bfd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Oct 24 16:30:58 2019 +0100

    Further work on file names
    
    This addresses
    ```latex
    \typeout{[\file_full_name:n{a~b}]}
    \typeout{[\file_full_name:n{zzz-noext}]}
    \typeout{[\file_full_name:n{space~here/abc}]}
    ```
    as raised by David (I was not passing the name of the
    directory!), but leaves a couple of LuaTeX-specific ones.


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

096dcaa87f72ec95d69d2c43bf05f02b3e453bfd
 l3kernel/l3file.dtx | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index f9b92d91a..8b13d91dd 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2607,13 +2607,9 @@
 % \begin{macro}[rEXP]{\@@_name_cleanup:w}
 % \begin{macro}[rEXP]{\@@_name_end:}
 % \begin{macro}[rEXP]{\@@_name_ext_check:n}
-% \begin{macro}[rEXP]
-%   {
-%     \@@_name_ext_check_auxi:w  ,
-%     \@@_name_ext_check_auxii:w ,
-%     \@@_name_ext_check_auxiii:nw
-%   }
-% \begin{macro}[rEXP]{\@@_name_ext_check_auxiv:nn}
+% \begin{macro}[rEXP]{\@@_name_ext_check:nw}
+% \begin{macro}[rEXP]{\@@_name_ext_check:nnw}
+% \begin{macro}[rEXP]{\@@_name_ext_check:nn}
 %   File searching can be carried out if the \tn{pdffilesize} primitive
 %   or an equivalent is available. That of course means we need to
 %   arrange for everything else to here to be done by expansion too.
@@ -2672,28 +2668,30 @@
 \cs_new:Npn \@@_name_end: { }
 %    \end{macrocode}
 %   As \TeX{} automatically adds |.tex| if there is no extension,
-%   there is a little clean up to do here. First, find the file
-%   extension if present.
+%   there is a little clean up to do here. First, make sure we are not in the
+%   directory part, saving that. Then check for an extension.
 %    \begin{macrocode}
 \cs_new:Npn \@@_ext_check:n #1
-  { \@@_ext_check_auxii:w #1 / \q_nil / \q_stop }
-\cs_new:Npn \@@_ext_check_auxii:w #1 / #2 / #3 \q_stop
+  { \@@_ext_check:nw { / } #1 / \q_nil / \q_stop }
+\cs_new:Npn \@@_ext_check:nw #1 #2 / #3 / #4 \q_stop
   {
-    \quark_if_nil:nTF {#2}
-      { \@@_ext_check_auxiii:nw {#1} #1 . \q_nil . \q_stop }
-      { \@@_ext_check_auxii:w #2 / #3 \q_stop }
+    \quark_if_nil:nTF {#3}
+      {
+        \exp_args:No \@@_ext_check:nnw
+          { \use_none:n #1 } {#2} #2 . \q_nil . \q_stop
+      }
+      { \@@_ext_check:nw { #1 #2 / } #3 / #4 \q_stop }
   }
-\cs_new:Npx \@@_ext_check_auxiii:nw #1#2 . #3 . #4 \q_stop
+\cs_new:Npx \@@_ext_check:nnw #1#2#3 . #4 . #5 \q_stop
   {
-    \exp_not:N \quark_if_nil:nTF {#3}
+    \exp_not:N \quark_if_nil:nTF {#4}
       {
-        \exp_not:N \@@_ext_check_auxiv:nn
-          {#1}
-          { #1 \tl_to_str:n { .tex } }
+        \exp_not:N \@@_ext_check:nn
+          { #1 #2 } { #1 #2 \tl_to_str:n { .tex } }
       }
-      {#1}
+      { #1 #2 }
   }
-\cs_new:Npn \@@_ext_check_auxiv:nn #1#2
+\cs_new:Npn \@@_ext_check:nn #1#2
   {
     \tl_if_blank:eTF { \@@_size:n {#2} }
       {#1}
@@ -2733,6 +2731,8 @@
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\file_get_full_name:nN, \file_get_full_name:VN}
 % \begin{macro}[TF]{\file_get_full_name:nN, \file_get_full_name:VN}





More information about the latex3-commits mailing list