[latex3-commits] [git/LaTeX3-latex3-latex3] main: Avoid blank entry in seq if "ls" gives nothing (2002c197a)
Joseph Wright
joseph.wright at morningstar2.co.uk
Wed Apr 6 08:40:13 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/2002c197aae89a53f496b7344eb0278e617ceb6a
>---------------------------------------------------------------
commit 2002c197aae89a53f496b7344eb0278e617ceb6a
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Apr 6 07:38:50 2022 +0100
Avoid blank entry in seq if "ls" gives nothing
>---------------------------------------------------------------
2002c197aae89a53f496b7344eb0278e617ceb6a
l3experimental/CHANGELOG.md | 4 ++++
l3experimental/l3sys-shell/l3sys-shell.dtx | 2 ++
2 files changed, 6 insertions(+)
diff --git a/l3experimental/CHANGELOG.md b/l3experimental/CHANGELOG.md
index adb32cd3b..b12532edd 100644
--- a/l3experimental/CHANGELOG.md
+++ b/l3experimental/CHANGELOG.md
@@ -7,6 +7,10 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Changed
+- Return an empty `seq` when `\sys_shell_split_ls:nN` is applied with a
+ glob which matched no entries
+
## [2022-02-05]
### Changed
diff --git a/l3experimental/l3sys-shell/l3sys-shell.dtx b/l3experimental/l3sys-shell/l3sys-shell.dtx
index cf8ecdf18..6975f65d0 100644
--- a/l3experimental/l3sys-shell/l3sys-shell.dtx
+++ b/l3experimental/l3sys-shell/l3sys-shell.dtx
@@ -393,6 +393,8 @@
\seq_set_split:NnV #2 { \char_generate:nn { `\^^M } { 12 } }
\exp_not:N \l_@@_tmp_tl
\seq_pop_right:NN #2 \exp_not:N \l_@@_tmp_tl
+ \exp_not:N \tl_if_blank:eTF { \exp_not:N \seq_item:Nn #2 { 1 } }
+ { \seq_clear:N #2 }
}
}
% \end{macrocode}
More information about the latex3-commits
mailing list.