always BRACE_EXPAND

no binary change
This commit is contained in:
tg 2004-12-18 19:27:21 +00:00
parent d5ff21ea1d
commit 6354a66090
5 changed files with 10 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/conf-end.h,v 2.5 2004/12/18 19:17:10 tg Exp $ */
/** $MirBSD: src/bin/ksh/conf-end.h,v 2.6 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: conf-end.h,v 1.2 1996/08/25 12:37:58 downsj Exp $ */
#ifndef CONF_END_H
@ -7,9 +7,6 @@
/* Include job control? */
#define JOBS 1
/* Include brace-expansion? */
#define BRACE_EXPAND 1
/* Include complex history? */
#define COMPLEX_HISTORY

17
eval.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/eval.c,v 2.5 2004/12/18 19:22:29 tg Exp $ */
/** $MirBSD: src/bin/ksh/eval.c,v 2.6 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: eval.c,v 1.18 2004/12/13 16:37:06 millert Exp $ */
/*
@ -10,7 +10,7 @@
#include "ksh_dir.h"
#include "ksh_stat.h"
__RCSID("$MirBSD: src/bin/ksh/eval.c,v 2.5 2004/12/18 19:22:29 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/eval.c,v 2.6 2004/12/18 19:27:21 tg Exp $");
/*
* string expansion
@ -54,10 +54,8 @@ static char *maybe_expand_tilde(char *p, XString *dsp, char **dpp,
int isassign);
static char *tilde(char *acp);
static char *homedir(char *name);
#ifdef BRACE_EXPAND
static void alt_expand(XPtrV *wp, char *start, char *exp_start,
char *end, int fdo);
#endif
/* compile and expand word */
char *
@ -184,10 +182,8 @@ expand(char *cp, XPtrV *wp, int f)
f &= ~DOGLOB;
if (Flag(FMARKDIRS))
f |= DOMARKDIRS;
#ifdef BRACE_EXPAND
if (Flag(FBRACEEXPAND) && (f & DOGLOB))
f |= DOBRACE_;
#endif /* BRACE_EXPAND */
Xinit(ds, dp, 128, ATEMP); /* init dest. string */
type = XBASE;
@ -562,15 +558,12 @@ expand(char *cp, XPtrV *wp, int f)
*dp++ = '\0';
p = Xclose(ds, dp);
#ifdef BRACE_EXPAND
if (fdo & DOBRACE_)
/* also does globbing */
alt_expand(wp, p, p,
p + Xlength(ds, (dp - 1)),
fdo | (f & DOMARKDIRS));
else
#endif /* BRACE_EXPAND */
if (fdo & DOGLOB)
else if (fdo & DOGLOB)
glob(p, wp, f & DOMARKDIRS);
else if ((f & DOPAT) || !(fdo & DOMAGIC_))
XPput(*wp, p);
@ -625,7 +618,6 @@ expand(char *cp, XPtrV *wp, int f)
*dp++ = MAGIC;
}
break;
#ifdef BRACE_EXPAND
case OBRACE:
case ',':
case CBRACE:
@ -636,7 +628,6 @@ expand(char *cp, XPtrV *wp, int f)
*dp++ = MAGIC;
}
break;
#endif /* BRACE_EXPAND */
case '=':
/* Note first unquoted = for ~ */
if (!(f & DOTEMP_) && !saw_eq) {
@ -1236,7 +1227,6 @@ homedir(char *name)
return ap->val.s;
}
#ifdef BRACE_EXPAND
static void
alt_expand(XPtrV *wp, char *start, char *exp_start, char *end, int fdo)
{
@ -1312,4 +1302,3 @@ alt_expand(XPtrV *wp, char *start, char *exp_start, char *end, int fdo)
}
return;
}
#endif /* BRACE_EXPAND */

6
main.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/main.c,v 2.10 2004/12/18 19:22:30 tg Exp $ */
/** $MirBSD: src/bin/ksh/main.c,v 2.11 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: main.c,v 1.28 2004/08/23 14:56:32 millert Exp $ */
/*
@ -15,7 +15,7 @@
* shell version
*/
__RCSID("$MirBSD: src/bin/ksh/main.c,v 2.10 2004/12/18 19:22:30 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/main.c,v 2.11 2004/12/18 19:27:21 tg Exp $");
const char ksh_version[] =
"@(#)PD KSH v5.2.14 MirOS R20 in "
@ -183,9 +183,7 @@ main(int argc, char *argv[])
* brace expansion, so set this before setting up FPOSIX
* (change_flag() clears FBRACEEXPAND when FPOSIX is set).
*/
#ifdef BRACE_EXPAND
Flag(FBRACEEXPAND) = 1;
#endif /* BRACE_EXPAND */
/* Check to see if we're /bin/sh. */
if (!strcmp(&kshname[strlen(kshname) - 3], "/sh")

11
misc.c
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/misc.c,v 2.6 2004/12/18 19:22:30 tg Exp $ */
/** $MirBSD: src/bin/ksh/misc.c,v 2.7 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: misc.c,v 1.20 2003/10/22 07:40:38 jmc Exp $ */
/*
@ -13,7 +13,7 @@
#include <sys/ioctl.h>
#include "ksh_stat.h"
__RCSID("$MirBSD: src/bin/ksh/misc.c,v 2.6 2004/12/18 19:22:30 tg Exp $");
__RCSID("$MirBSD: src/bin/ksh/misc.c,v 2.7 2004/12/18 19:27:21 tg Exp $");
#ifndef UCHAR_MAX
# define UCHAR_MAX 0xFF
@ -128,9 +128,7 @@ const struct option options[] = {
* entries MUST match the order of sh_flag F* enumerations in sh.h.
*/
{ "allexport", 'a', OF_ANY },
#ifdef BRACE_EXPAND
{ "braceexpand", 0, OF_ANY }, /* non-standard */
#endif
{ "bgnice", 0, OF_ANY },
{ NULL, 'c', OF_CMDLINE },
{ "emacs", 0, OF_ANY },
@ -291,10 +289,7 @@ change_flag(enum sh_flag f, int what, int newval)
setegid(getgid());
setgid(getgid());
} else if (f == FPOSIX && newval) {
#ifdef BRACE_EXPAND
Flag(FBRACEEXPAND) = 0
#endif /* BRACE_EXPAND */
;
Flag(FBRACEEXPAND) = 0;
}
/* Changing interactive flag? */
if (f == FTALKING) {

4
sh.h
View File

@ -1,4 +1,4 @@
/** $MirBSD: src/bin/ksh/sh.h,v 2.5 2004/12/18 19:17:10 tg Exp $ */
/** $MirBSD: src/bin/ksh/sh.h,v 2.6 2004/12/18 19:27:21 tg Exp $ */
/* $OpenBSD: sh.h,v 1.18 2004/05/31 10:36:35 otto Exp $ */
#ifndef SH_H
@ -422,9 +422,7 @@ extern const struct option options[];
*/
enum sh_flag {
FEXPORT = 0, /* -a: export all */
#ifdef BRACE_EXPAND
FBRACEEXPAND, /* enable {} globbing */
#endif
FBGNICE, /* bgnice */
FCOMMAND, /* -c: (invocation) execute specified command */
FEMACS, /* emacs command editing */