From 78da7d872ecd24299b97573bf92c9582c74992b6 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 16 Jun 2004 15:10:13 +0000 Subject: users/7553: include zsh version in dump file to avoid problems with upgrades --- Completion/compdump | 2 +- Completion/compinit | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'Completion') diff --git a/Completion/compdump b/Completion/compdump index c762eee51..7b43a2668 100644 --- a/Completion/compdump +++ b/Completion/compdump @@ -33,7 +33,7 @@ if [[ -n "$_comp_secure" ]]; then (( $#_d_wdirs )) && _d_files=( "${(@)_d_files:#(${(j:|:)_d_wdirs})/*}" ) fi -print "#files: $#_d_files" > $_d_file +print "#files: $#_d_files\tversion: $ZSH_VERSION" > $_d_file # Dump the arrays _comps, _services and _patcomps. The quoting # hieroglyphics ensure that a single quote inside a variable is itself diff --git a/Completion/compinit b/Completion/compinit index 332a153ba..785ec5854 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -442,7 +442,9 @@ _i_done='' if [[ -f "$_comp_dumpfile" ]]; then if [[ -n "$_i_check" ]]; then read -rA _i_line < "$_comp_dumpfile" - if [[ _i_autodump -eq 1 && $_i_line[2] -eq $#_i_files ]]; then + if [[ _i_autodump -eq 1 && $_i_line[2] -eq $#_i_files && + $ZSH_VERSION = $_i_line[4] ]] + then builtin . "$_comp_dumpfile" _i_done=yes fi -- cgit 1.4.1