Skip to content

Commit

Permalink
Redundant fix against misinterpreting an empty \CurrentFile
Browse files Browse the repository at this point in the history
  • Loading branch information
PhelypeOleinik committed Jan 4, 2021
1 parent dac80c9 commit e248440
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions base/lthooks.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit e248440

Please sign in to comment.