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
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
DISTVERSIONPREFIX= v
|
||||
PORTNAME= ksh
|
||||
PORTVERSION= 1.0.5
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= shells
|
||||
|
||||
MAINTAINER= cy@FreeBSD.org
|
||||
|
||||
@@ -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 */
|
||||
Reference in New Issue
Block a user