Permalink
Browse files

20222: turn on max function depth

plus unposted reference to this in README
plus unposted neatening of 20219 history-pattern-search
  • Loading branch information...
1 parent b550cfe commit ab899b76c790d1cb13b76716d4d99b6bd7ac983c Peter Stephenson committed Jul 30, 2004
Showing with 63 additions and 25 deletions.
  1. +10 −0 ChangeLog
  2. +3 −1 Functions/Zle/history-pattern-search
  3. +17 −15 Functions/Zle/read-from-minibuffer
  4. +13 −0 INSTALL
  5. +15 −6 README
  6. +5 −3 configure.ac
View
@@ -1,3 +1,13 @@
+2004-07-30 Peter Stephenson <pws@csr.com>
+
+ * unposted: minor tidy up for 20219: neaten read-from-minibuffer
+ and make history-pattern-search use last pattern as default.
+
+ * unposted: README: mention max function depth is on by default
+
+ * 20222: INSTALL, configure.ac: turn on max function depth by
+ default to avoid crash.
+
2004-07-29 Peter Stephenson <pws@csr.com>
* 20221: Src/exec.c, Src/signals.c, Test/A05execution.ztst:
@@ -28,7 +28,9 @@ else
fi
# Read pattern. Prompt could be made customisable.
-read-from-minibuffer "pat ($dir): "
+read-from-minibuffer "pat ($dir): " $_last_history_pattern_search
+
+_last_history_pattern_search=$REPLY
# Abort if bad status or nothing entered
[[ $? -ne 0 || -z $REPLY ]] && return 0
@@ -5,15 +5,17 @@ local opt keys
integer stat
while getopts "k:" opt; do
- case $opt in
- (k)
- keys=$OPTARG
- ;;
-
- (*)
- return 1
- ;;
- esac
+ case $opt in
+ # Read the given number of keys. This is a bit
+ # ropey for more than a single key.
+ (k)
+ keys=$OPTARG
+ ;;
+
+ (*)
+ return 1
+ ;;
+ esac
done
(( OPTIND > 1 )) && shift $(( OPTIND - 1 ))
@@ -27,13 +29,13 @@ ${1:-? }"
POSTDISPLAY=
if [[ -n $keys ]]; then
- zle -R
- read -k $keys
- stat=$?
+ zle -R
+ read -k $keys
+ stat=$?
else
- zle recursive-edit
- stat=$?
- (( stat )) || REPLY=$BUFFER
+ zle recursive-edit
+ stat=$?
+ (( stat )) || REPLY=$BUFFER
fi
LBUFFER=$savelbuffer
View
@@ -330,6 +330,19 @@ $fpath array on shell startup. This directory will not be affected by
`make uninstall' or `make uninstall.fns', although the version-specific
directory and its contents will be deleted.
+Function depth
+--------------
+
+Shell functions may be called recursively. In order to detect infinite
+recursion the shell has a limit on the depth to which functions may be
+called: note that this is a single limit for all functions, not a limit
+for each function called recursively. The default for the limit is 4096.
+The limit may be altered to the value MAX by passing the option
+--enable-max-function-depth=MAX to configure. Alternatively, the limit may
+be disabled with --disable-max-function-depth. However, this is not
+recommended as it is likely to cause the shell to crash on an infinite
+recursion.
+
Support for large files and integers
------------------------------------
View
@@ -25,14 +25,23 @@ Possible incompatibilities
---------------------------
Currently the only known incompatibilities between 4.2.0 and later
-versions are minor: IPv6 addresses must be specified in
-square brackets in the zftp module and function system; special
-traps for pseudosignals ZERR, DEBUG and EXIT are no longer executed
-inside other traps (users may well have assumed this was the case anyway
-since the behaviour was not explicity documented). See the NEWS file for
+versions are minor:
+
+IPv6 addresses must be specified in square brackets in the zftp module and
+the function system built on top of the zftp module.
+
+Special traps for pseudosignals ZERR, DEBUG and EXIT are no longer executed
+inside other traps. Users may well have assumed this was the case anyway
+since the behaviour was not explicity documented. See the NEWS file for
more detail.
-Some particular differences you may notice since version 4.0:
+By default, a maximum function depth of 4096 is now compiled into the
+shell. This may be altered during configuration; see `Function depth' in
+INSTALL.
+
+
+Some particular differences you may notice between the 4.0 and 4.2 series
+of releases:
The bash-compatibility zle functions described in the zshcontrib manual
page have been removed as a more configurable set of editing widgets for
View
@@ -301,12 +301,14 @@ ifdef([max_function_depth],[undefine([max_function_depth])])dnl
AH_TEMPLATE([MAX_FUNCTION_DEPTH],
[Define for function depth limits])
AC_ARG_ENABLE(max-function-depth,
-[ --enable-max-function-depth=MAX limit function depth to MAX],
+[ --enable-max-function-depth=MAX limit function depth to MAX, default 4096],
[if test x$enableval = xyes; then
AC_DEFINE(MAX_FUNCTION_DEPTH, 4096)
-else
+elif test x$enableval != xno; then
AC_DEFINE_UNQUOTED(MAX_FUNCTION_DEPTH, $enableval)
-fi])
+fi],
+[AC_DEFINE(MAX_FUNCTION_DEPTH, 4096)]
+)
dnl Do you want to look for pcre support?
AC_ARG_ENABLE(pcre,

0 comments on commit ab899b7

Please sign in to comment.