git: a2ba1fd2c5cd - main - shells/ksh: Fix ksh 1.0.5 Regression (issue #660)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 12 Jun 2023 09:20:14 UTC
The branch main has been updated by cy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=a2ba1fd2c5cdc5d3a672126b4c4a06251df3dfb5
commit a2ba1fd2c5cdc5d3a672126b4c4a06251df3dfb5
Author: Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-06-12 09:03:52 +0000
Commit: Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-06-12 09:19:55 +0000
shells/ksh: Fix ksh 1.0.5 Regression (issue #660)
From issue #660:
Globs are not expanded with the following:
% echo "/"{bin,sbin}"/*"
/bin/* /sbin/*
% v=/; echo "$v"bin"/*"
/bin/*
But globbing is unexpectedly performed if both parameter substitution
and brace expansion are present:
% v=/; echo "$v"{bin,sbin}"/*"
[output omitted for the sake of brevity]
Obtained from: https://github.com/ksh93/ksh/issues/660
MFH: 2023Q3
---
shells/ksh/Makefile | 1 +
shells/ksh/files/patch-src_cmd_ksh93_sh_macro.c | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/shells/ksh/Makefile b/shells/ksh/Makefile
index 26617ec47ba0..319bdab02d59 100644
--- a/shells/ksh/Makefile
+++ b/shells/ksh/Makefile
@@ -11,6 +11,7 @@
DISTVERSIONPREFIX= v
PORTNAME= ksh
PORTVERSION= 1.0.5
+PORTREVISION= 1
CATEGORIES= shells
MAINTAINER= cy@FreeBSD.org
diff --git a/shells/ksh/files/patch-src_cmd_ksh93_sh_macro.c b/shells/ksh/files/patch-src_cmd_ksh93_sh_macro.c
new file mode 100644
index 000000000000..391cff245ac6
--- /dev/null
+++ b/shells/ksh/files/patch-src_cmd_ksh93_sh_macro.c
@@ -0,0 +1,13 @@
+diff --git src/cmd/ksh93/sh/macro.c.orig src/cmd/ksh93/sh/macro.c
+index aba6f9d..0d60219 100644
+--- src/cmd/ksh93/sh/macro.c.orig
++++ src/cmd/ksh93/sh/macro.c
+@@ -2582,7 +2582,7 @@ static void endfield(Mac_t *mp,int split)
+ mp->atmode = 0;
+ if(mp->patfound)
+ {
+- int musttrim = mp->wasexpan && !mp->noextpat && strchr(argp->argval,'\\');
++ int musttrim = mp->wasexpan && !mp->quoted && !mp->noextpat && strchr(argp->argval,'\\');
+ sh.argaddr = 0;
+ #if SHOPT_BRACEPAT
+ /* in POSIX mode, disallow brace expansion for unquoted expansions */