Skip to content

Commit

Permalink
Do not drop path in replacement file name
Browse files Browse the repository at this point in the history
  • Loading branch information
PhelypeOleinik committed Nov 20, 2020
1 parent b386903 commit 4b2ed6b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions base/ltfilehook.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -796,8 +796,8 @@
%
%
% \begin{macro}{\@@_subst_add:nn,\@@_subst_remove:n,
% \@@_subst_file_normalize:n,\@@_subst_empty_name_chk:NN}
% \cs{@@_substitution_lthooadd:nn} declares a file substitution by
% \@@_subst_file_normalize:Nn,\@@_subst_empty_name_chk:NN}
% \cs{@@_subst_add:nn} declares a file substitution by
% doing a (global) definition of the form
% |\def|\cs{@file-subst@\meta{file}}|{|\meta{replacement}|}|.
% The file names are properly sanitised, and normalized with the same
Expand All @@ -811,23 +811,31 @@
\group_begin:
\cs_set:cpx { } { \exp_not:o { \cs:w\cs_end: } }
\int_set:Nn \tex_escapechar:D { -1 }
\cs_gset:cpx { @file-subst@ \@@_subst_file_normalize:n {#1} }
{ \@@_subst_file_normalize:n {#2} }
\cs_gset:cpx
{
@file-subst@
\@@_subst_file_normalize:Nn \use_ii_iii:nnn {#1}
}
{ \@@_subst_file_normalize:Nn \@@_file_name_compose:nnn {#2} }
\group_end:
}
\cs_new_protected:Npn \@@_subst_remove:n #1
{
\group_begin:
\cs_set:cpx { } { \exp_not:o { \cs:w\cs_end: } }
\int_set:Nn \tex_escapechar:D { -1 }
\cs_undefine:c { @file-subst@ \@@_subst_file_normalize:n {#1} }
\cs_undefine:c
{
@file-subst@
\@@_subst_file_normalize:Nn \use_ii_iii:nnn {#1}
}
\group_end:
}
\cs_new:Npn \@@_subst_file_normalize:n #1
\cs_new:Npn \@@_subst_file_normalize:Nn #1 #2
{
\exp_after:wN \@@_subst_empty_name_chk:NN
\cs:w \exp_after:wN \cs_end:
\cs:w \@@_file_parse_full_name:nN {#1} \use_ii_iii:nnn \cs_end:
\cs:w \@@_file_parse_full_name:nN {#2} #1 \cs_end:
}
\cs_new:Npn \@@_subst_empty_name_chk:NN #1 #2
{ \if_meaning:w #1 #2 .tex \else: \token_to_str:N #2 \fi: }
Expand Down

0 comments on commit 4b2ed6b

Please sign in to comment.