10564: typo in _wanted

10565: maximum function depth configure option
10566: patgetglobflags has a second argument now
This commit is contained in:
Clint Adams 2000-04-07 02:27:44 +00:00
parent d2330ba055
commit 18870148c5
6 changed files with 113 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2000-04-06 Clint Adams <schizo@debian.org>
* Felix Rosencrantz: 10564: Completion/X/_x_display:
typo in _wanted.
* 10565: acconfig.h, configure.in, Src/exec.c:
add configure option for function depth limit.
* 10566: Src/glob.c: change invocation of patgetglobflags
to use two arguments.
2000-04-06 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
* 10547: Doc/Zsh/expn.yo, Misc/globtests, Src/pattern.c,

View file

@ -1,3 +1,3 @@
#autoload
_hosts -S ':0 ' -r :
_wanted displays && _hosts -S ':0 ' -r :

View file

@ -3251,6 +3251,9 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval)
char saveopts[OPT_SIZE], *oldscriptname = NULL, *fname = dupstring(name);
int obreaks;
struct funcstack fstack;
#ifdef MAX_FUNCTION_DEPTH
static int funcdepth;
#endif
pushheap();
@ -3300,6 +3303,13 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval)
argzero = ztrdup(argzero);
}
}
#ifdef MAX_FUNCTION_DEPTH
if(++funcdepth > MAX_FUNCTION_DEPTH)
{
zerr("maximum nested function level reached", NULL, 0);
return;
}
#endif
fstack.name = dupstring(name);
fstack.prev = funcstack;
funcstack = &fstack;
@ -3323,6 +3333,9 @@ doshfunc(char *name, Eprog prog, LinkList doshargs, int flags, int noreturnval)
}
runshfunc(prog, wrappers, fstack.name);
funcstack = fstack.prev;
#ifdef MAX_FUNCTION_DEPTH
--funcdepth;
#endif
if (retflag) {
retflag = 0;
breaks = obreaks;

View file

@ -698,6 +698,8 @@ parsecomplist(char *instr)
static Complist
parsepat(char *str)
{
long assert;
patcompstart();
/*
* Check for initial globbing flags, so that they don't form
@ -707,7 +709,7 @@ parsepat(char *str)
(isset(KSHGLOB) && *str == '@' && str[1] == Inpar &&
str[2] == Pound)) {
str += (*str == Inpar) ? 2 : 3;
if (!patgetglobflags(&str))
if (!patgetglobflags(&str, &assert))
return NULL;
}

View file

@ -73,6 +73,9 @@
/* Define to 1 if you have RFS superroot directory. */
#undef HAVE_SUPERROOT
/* Define to 1 if you need to use the native getcwd */
#undef USE_GETCWD
/* Define to the path of the /dev/fd filesystem */
#undef PATH_DEV_FD
@ -130,6 +133,9 @@
/* Define if your system's struct direct has a member named d_stat. */
#undef HAVE_STRUCT_DIRECT_D_STAT
/* Define if your system's struct sockaddr_in6 has a member named sin6_scope_id. */
#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
/* Define to be a string corresponding the vendor of the machine */
#undef VENDOR
@ -155,6 +161,20 @@
* hash tables. This turns on the `hashinfo' builtin. */
#undef ZSH_HASH_DEBUG
/* Undefine this if you don't want to get a restricted shell *
* when zsh is exec'd with basename that starts with r. *
* By default this is defined. */
#undef RESTRICTED_R
/* Define for Maildir support */
#undef MAILDIR_SUPPORT
/* Define for function depth limits */
#undef MAX_FUNCTION_DEPTH
/* Define if you want locale features. By default this is defined. */
#undef CONFIG_LOCALE
/* Define to 1 if your termcap library has the ospeed variable */
#undef HAVE_OSPEED
/* Define to 1 if you have ospeed, but it is not defined in termcap.h */
@ -181,9 +201,6 @@
/* Define to 1 if struct timezone is defined by a system header */
#undef HAVE_STRUCT_TIMEZONE
/* Define if your system's typeahead disappears from the shell editor. */
#undef CLOBBERS_TYPEAHEAD
/* Define to 1 if there is a prototype defined for brk() on your system */
#undef HAVE_BRK_PROTO
@ -193,13 +210,22 @@
/* Define to 1 if there is a prototype defined for ioctl() on your system */
#undef HAVE_IOCTL_PROTO
/* Define to 1 if there is a prototype defined for mknod() on your system */
#undef HAVE_MKNOD_PROTO
/* Define to 1 if select() is defined in <sys/socket.h>, ie BeOS R4.51*/
#undef SELECT_IN_SYS_SOCKET_H
/* Define to 1 if system has working FIFO's */
#undef HAVE_FIFOS
/* Define to 1 if struct rlimit use quad_t */
/* Define to 1 if struct rlimit uses quad_t */
#undef RLIM_T_IS_QUAD_T
/* Define to 1 if rlimit use unsigned */
/* Define to 1 if struct rlimit uses long long */
#undef RLIM_T_IS_LONG_LONG
/* Define to 1 if rlimit uses unsigned */
#undef RLIM_T_IS_UNSIGNED
/* Define to the type used in struct rlimit */
@ -208,6 +234,21 @@
/* Define to 1 if /bin/sh does not interpret \ escape sequences */
#undef SH_USE_BSD_ECHO
/* Define to 1 if system has working link() */
#undef HAVE_LINK
/* Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51 */
#undef BROKEN_KILL_ESRCH
/* Define to 1 if sigsuspend() is broken, ie BeOS R4.51 */
#undef BROKEN_POSIX_SIGSUSPEND
/* Define to 1 if getpwnam() is faked, ie BeOS R4.51 */
#undef GETPWNAM_FAKED
/* Define to 1 if tcsetpgrp() doesn't work, ie BeOS R4.51 */
#undef BROKEN_TCSETPGRP
/* Define to 1 if an underscore has to be prepended to dlsym() argument */
#undef DLSYM_NEEDS_UNDERSCORE
@ -219,3 +260,35 @@
/* Define to 1 if you want to use dynamically loaded modules */
#undef DYNAMIC
/* Define to 1 if you want to use dynamically loaded modules on AIX */
#undef AIXDYNAMIC
/* Define to 1 if you want to use dynamically loaded modules on HPUX 10 */
#undef HPUXDYNAMIC
/* Define to `unsigned long' if <sys/types.h> doesn't define. */
#undef ino_t
/*
* Definitions used when a long is less than eight byte, to try to
* provide some support for eight byte operations.
*
* Note that ZSH_64_BIT_TYPE, OFF_T_IS_64_BIT, INO_T_IS_64_BIT do *not* get
* defined if long is already 64 bits, since in that case no special handling
* is required.
*/
/* Define to 1 if long is 64 bits */
#undef LONG_IS_64_BIT
/* Define to a 64 bit integer type if there is one, but long is shorter */
#undef ZSH_64_BIT_TYPE
/* Define to an unsigned variant of ZSH_64_BIT_TYPE if that is defined */
#undef ZSH_64_BIT_UTYPE
/* Define to 1 if off_t is 64 bit (for large file support) */
#undef OFF_T_IS_64_BIT
/* Define to 1 if ino_t is 64 bit (for large file support) */
#undef INO_T_IS_64_BIT

View file

@ -271,6 +271,16 @@ AC_ARG_ENABLE(maildir-support,
AC_DEFINE(MAILDIR_SUPPORT)
fi])
dnl Do you want to set a maximum function depth?
undefine([max_function_depth])dnl
AC_ARG_ENABLE(max-function-depth,
[ --enable-max-function-depth=MAX Limit function depth to MAX],
[if test x$enableval = xyes; then
AC_DEFINE(MAX_FUNCTION_DEPTH, 4096)
else
AC_DEFINE_UNQUOTED(MAX_FUNCTION_DEPTH, $enableval)
fi])
dnl ------------------
dnl CHECK THE COMPILER
dnl ------------------