diff --git a/base/ltfilehook.dtx b/base/ltfilehook.dtx index 95f8e14d7..50f6785c8 100644 --- a/base/ltfilehook.dtx +++ b/base/ltfilehook.dtx @@ -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 @@ -811,8 +811,12 @@ \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 @@ -820,14 +824,18 @@ \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: }