diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty b/Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty index 2524684f225..f08e91bba4b 100644 --- a/Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty +++ b/Master/texmf-dist/tex/latex/l3experimental/l3sys-shell/l3sys-shell.sty @@ -20,7 +20,7 @@ %% %% File: l3sys-shell.dtx \RequirePackage{expl3} -\ProvidesExplPackage{l3sys-shell}{2024-01-04}{} +\ProvidesExplPackage{l3sys-shell}{2024-02-20}{} {L3 Experimental system shell functions} \scan_new:N \s__sys_stop \quark_new:N \q__sys_nil @@ -132,6 +132,7 @@ } } } +\seq_new:N \l__sys_tmp_seq \tl_new:N \l__sys_tmp_tl \cs_new_protected:Npe \sys_get_shell_pwd:N #1 { @@ -158,10 +159,11 @@ { \sys_if_shell_unrestricted:T { - \exp_not:N \sys_get_shell:nnN + \exp_not:N \exp_args:Ne \exp_not:N \sys_get_shell:nnN { \sys_if_platform_unix:T { ls~-1~ #1 } - \sys_if_platform_windows:T { dir~/b~ #1 } + \sys_if_platform_windows:T + { dir~/b~/s~ \exp_not:N \__sys_path_to_win:n {#1} } } { \ExplSyntaxOff @@ -178,7 +180,31 @@ \seq_pop_right:NN #2 \exp_not:N \l__sys_tmp_tl \exp_not:N \tl_if_blank:eTF { \exp_not:N \seq_item:Nn #2 { 1 } } { \seq_clear:N #2 } + \sys_if_platform_windows:T + { + \sys_get_shell_pwd:N \exp_not:N \l__sys_tmp_tl + \exp_not:N \exp_args:NV \exp_not:N \__sys_shell_split_ls:nN + \exp_not:N \l__sys_tmp_tl #2 + } + } + } +\sys_if_platform_windows:T + { + \cs_new_protected:Npe \__sys_shell_split_ls:nN #1#2 + { + \cs_set:Npn \exp_not:N \__sys_shell_split_ls:w #1 \c_backslash_str { } + \seq_set_eq:NN \exp_not:N \l__sys_tmp_seq #2 + \seq_clear:N #2 + \seq_map_inline:Nn \exp_not:N \l__sys_tmp_seq + { + \tl_set:Ne \exp_not:N \l__sys_tmp_tl + { \exp_not:N \__sys_shell_split_ls:w ##1 } + \tl_replace_all:Nnn \exp_not:N \l__sys_tmp_tl + { \c_backslash_str } { / } + \seq_put_right:NV #2 \exp_not:N \l__sys_tmp_tl + } } + \cs_new:Npn \__sys_shell_split_ls:w { } } %% %% |