[latex3-commits] [git/LaTeX3-latex3-latex2e] hotfix/gh464: Redundant fix against misinterpreting an empty \CurrentFile (f66ba88e)

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Jan 4 05:51:41 CET 2021


Repository : https://github.com/latex3/latex2e
On branch  : hotfix/gh464
Link       : https://github.com/latex3/latex2e/commit/f66ba88e8c93dcbde6878652aed190622ca858c0

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

commit f66ba88e8c93dcbde6878652aed190622ca858c0
Author: PhelypeOleinik <phelype.oleinik at latex-project.org>
Date:   Mon Jan 4 01:51:41 2021 -0300

    Redundant fix against misinterpreting an empty \CurrentFile


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

f66ba88e8c93dcbde6878652aed190622ca858c0
 base/lthooks.dtx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index 87f13767..16cd780c 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2565,11 +2565,17 @@
   { \@@_strip_double_slash:n {#1} }
 \cs_new:Npn \@@_strip_double_slash:n #1
   { \@@_strip_double_slash:w #1 // \s_@@_mark }
-\cs_new:Npn \@@_strip_double_slash:w #1 // #2 \s_@@_mark
+%    \end{macrocode}
+%   This function is always called after testing if the argument is a
+%   file hook with \cs{@@_if_file_hook:wTF}, so we can assume it has
+%   three parts, so we use \verb|#1/#2/#3 //| instead of just
+%   \verb|#1 //| to prevent losing a slash if the file name is empty.
+%    \begin{macrocode}
+\cs_new:Npn \@@_strip_double_slash:w #1/#2/#3 // #4 \s_@@_mark
   {
-    \tl_if_empty:nTF {#2}
-      {#1}
-      { \@@_strip_double_slash:w #1 / #2 \s_@@_mark }
+    \tl_if_empty:nTF {#4}
+      { #1/#2/#3 }
+      { \@@_strip_double_slash:w #1/#2/#3 / #4 \s_@@_mark }
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list.