aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2023-06-12 09:13:16 +0000
committerCy Schubert <cy@FreeBSD.org>2023-06-12 09:19:56 +0000
commita7c0df3a9c1c5235723f9db41e6c11ee4330123f (patch)
tree373a36a5533f494c7dd4ed49fafe6484508b43aa
parenta2ba1fd2c5cdc5d3a672126b4c4a06251df3dfb5 (diff)
downloadports-a7c0df3a9c1c5235723f9db41e6c11ee4330123f.tar.gz
ports-a7c0df3a9c1c5235723f9db41e6c11ee4330123f.zip
shells/ksh-devel: 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
-rw-r--r--shells/ksh-devel/Makefile1
-rw-r--r--shells/ksh-devel/files/patch-src_cmd_ksh93_sh_macro.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/shells/ksh-devel/Makefile b/shells/ksh-devel/Makefile
index 50dc9ae2290c..17c7428c9a9a 100644
--- a/shells/ksh-devel/Makefile
+++ b/shells/ksh-devel/Makefile
@@ -10,6 +10,7 @@
PORTNAME= ksh
PORTVERSION= ${AST_COMMIT_DATE}
+PORTREVISION= 1
CATEGORIES= shells
PKGNAMESUFFIX= -devel
diff --git a/shells/ksh-devel/files/patch-src_cmd_ksh93_sh_macro.c b/shells/ksh-devel/files/patch-src_cmd_ksh93_sh_macro.c
new file mode 100644
index 000000000000..391cff245ac6
--- /dev/null
+++ b/shells/ksh-devel/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 */