Skip to content

Commit

Permalink
shells/ksh-devel: Fix ksh 1.0.5 Regression (issue #660)
Browse files Browse the repository at this point in the history
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:  ksh93/ksh#660
  • Loading branch information
cschuber committed Jun 12, 2023
1 parent a2ba1fd commit a7c0df3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions shells/ksh-devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

PORTNAME= ksh
PORTVERSION= ${AST_COMMIT_DATE}
PORTREVISION= 1
CATEGORIES= shells
PKGNAMESUFFIX= -devel

Expand Down
13 changes: 13 additions & 0 deletions shells/ksh-devel/files/patch-src_cmd_ksh93_sh_macro.c
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit a7c0df3

Please sign in to comment.