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

PhelypeOleinik phelype.oleinik at latex-project.org
Mon Jan 4 06:11:32 CET 2021


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

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

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

    Redundant fix against misinterpreting an empty \CurrentFile


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

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

diff --git a/base/lthooks.dtx b/base/lthooks.dtx
index cc79892c..765bf608 100644
--- a/base/lthooks.dtx
+++ b/base/lthooks.dtx
@@ -2527,11 +2527,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.