diff options
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | Completion/Unix/Command/_make | 34 | ||||
-rw-r--r-- | Completion/Unix/Command/_python | 2 | ||||
-rw-r--r-- | Completion/Zsh/Context/_redirect | 3 | ||||
-rw-r--r-- | Src/jobs.c | 2 | ||||
-rw-r--r-- | Src/zsh_system.h | 3 | ||||
-rw-r--r-- | configure.ac | 8 |
7 files changed, 67 insertions, 7 deletions
@@ -1,5 +1,27 @@ +2022-08-05 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * Felipe Contreras: 50435+50436 (+50444): + Completion/Unix/Command/_make: do not actually build anything. + Also include some performance improvements. + +2022-07-24 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp> + + * 50421: Completion/Zsh/Context/_redirect: add missing context + as the 1st argument to _dispatch + + * 50418: Src/zsh_system.h, configure.ac: use setenv(3)/getenv(3) + on newer macOS + +2022-07-16 Bart Schaefer <schaefer@Macadamia> + + * users/27852: Completion/Unix/Command/_python: Make a local copy + of $_compskip to avoid propagating outward any changes by _normal + 2022-06-21 Bart Schaefer <schaefer@zsh.org> + * 50379 (tweaked per 50380): Src/jobs.c: fix off-by-one + side-effect of workers/49906 that broke $(jobs -l) + * 50368: Src/Modules/db_gdbm.c: adjust bitflags so local copies of variables cannot mess with database file contents diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make index ae91440f0..510368e8b 100644 --- a/Completion/Unix/Command/_make +++ b/Completion/Unix/Command/_make @@ -118,10 +118,34 @@ _make-parseMakefile () { done } +_make-parseDataBase () { + local input var TAB=$'\t' IFS= skip=0 + + while read input + do + if [[ $skip = 1 ]]; then + skip=0 + continue + fi + case "$input " in + (\# Not a target*|\# environment*) + skip=1 # skip next line + ;; + ([[:alnum:]][[:alnum:]_]#[" "$TAB]#(\?|:|::|)=*) + var=${input%%[ $TAB]#(\?|:|::|)=*} + VARIABLES[$var]=1 + ;; + ([[*?[:alnum:]$][^$TAB:=%]#:[^=]*) + TARGETS+=( ${input%%:*} ) + ;; + esac + done +} + _make() { local prev="$words[CURRENT-1]" file expl tmp is_gnu incl match basedir nul=$'\0' - local context state state_descr line + local curcontext=$curcontext state state_descr line local -a option_specs local -A VARIABLES VAR_ARGS opt_args local -aU TARGETS keys @@ -185,7 +209,7 @@ _make() { ) fi - _arguments -s $option_specs \ + _arguments -C -S -s $option_specs \ '*:make target:->target' && ret=0 [[ $state = cdir ]] && cdir=-2 @@ -214,6 +238,10 @@ _make() { ;; (target) + # target name starting with '-' is allowed only after '--' + if [[ $words[CURRENT] = -* ]] && (( ${words[(i)--]} > CURRENT )); then + return ret + fi file=${(v)opt_args[(I)(-f|--file|--makefile)]} if [[ -n $file ]] then @@ -239,7 +267,7 @@ _make() { if [[ $is_gnu == gnu ]] then if zstyle -t ":completion:${curcontext}:targets" call-command; then - _make-parseMakefile < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" --always-make 2> /dev/null) + _make-parseDataBase < <(_call_program targets "$words[1]" -nqp --no-print-directory -f "$file" .DEFAULT 2> /dev/null) else _make-parseMakefile < $file fi diff --git a/Completion/Unix/Command/_python b/Completion/Unix/Command/_python index e5bac18bb..2711b8fd3 100644 --- a/Completion/Unix/Command/_python +++ b/Completion/Unix/Command/_python @@ -3,7 +3,7 @@ # Python 2.7 # Python 3.9 -local curcontext="$curcontext" state state_descr line +local curcontext="$curcontext" state state_descr line _compskip="$_compskip" typeset -A opt_args local -a args diff --git a/Completion/Zsh/Context/_redirect b/Completion/Zsh/Context/_redirect index e6da5d115..520a7666e 100644 --- a/Completion/Zsh/Context/_redirect +++ b/Completion/Zsh/Context/_redirect @@ -15,4 +15,5 @@ if [[ "$CURRENT" != "1" ]]; then fi fi -_dispatch -redirect-,{${compstate[redirect]},-default-},${^strs} +_dispatch -redirect-,${compstate[redirect]},$_comp_command \ + -redirect-,{${compstate[redirect]},-default-},${^strs} diff --git a/Src/jobs.c b/Src/jobs.c index e0e453ed8..707374297 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -2402,7 +2402,7 @@ bin_fg(char *name, char **argv, Options ops, int func) int curmaxjob, ignorejob; if (unset(MONITOR) && oldmaxjob) { jobptr = oldjobtab; - curmaxjob = oldmaxjob ? oldmaxjob - 1 : 0; + curmaxjob = oldmaxjob; ignorejob = 0; } else { jobptr = jobtab; diff --git a/Src/zsh_system.h b/Src/zsh_system.h index 6f4efce96..16f724401 100644 --- a/Src/zsh_system.h +++ b/Src/zsh_system.h @@ -783,7 +783,8 @@ extern char **environ; * We always need setenv and unsetenv in pairs, because * we don't know how to do memory management on the values set. */ -#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) && !defined(__APPLE__) +#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) \ + && !defined(SETENV_MANGLES_EQUAL) # define USE_SET_UNSET_ENV #endif diff --git a/configure.ac b/configure.ac index 77e381f50..890ef8dd2 100644 --- a/configure.ac +++ b/configure.ac @@ -1515,6 +1515,14 @@ else zsh_cv_use_xattr=no fi]) +dnl We don't want to use setenv(3) on El Capitan or older OS X because it +dnl removes a leading '=' from the value of the environment variable +AH_TEMPLATE([SETENV_MANGLES_EQUAL], +[Define to 1 if setenv removes a leading =]) +case $host_os in + darwin1[0-5]*) AC_DEFINE(SETENV_MANGLES_EQUAL) ;; +esac + dnl ------------- dnl CHECK SIGNALS dnl ------------- |