Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

bug: _store_cache and ksh arrays



Hello,

I think I found a bug.  _store_cache produces wrong output when
both KSH_TYPESET and MAGIC_EQUAL_SUBST are set.

Here's a piece of code:

  for var; do
    case ${(Pt)var} in
    (*readonly*) ;;
    (*(association|array)*) print -r "$var=( ${(kv@Pqq)^^var} )";;
    (*)                     print -r "$var=${(Pqq)^^var}";;
    esac
  done >! "$_cache_dir/$_cache_ident"

And here is how to reproduce a bug:

$ var=perl_modules
$ perl_modules=(AutoLoader DynaLoader SelfLoader)
$ emulate -R zsh
$ print -r "$var=( ${(kv@Pqq)^^var} )"
perl_modules=( 'AutoLoader' 'DynaLoader' 'SelfLoader' )
$ setopt KSH_TYPESET MAGIC_EQUAL_SUBST
$ print -r "$var=( ${(kv@Pqq)^^var} )"
perl_modules=( 'AutoLoader DynaLoader SelfLoader' )
$

So the cache data are unusable in the second case.
Actually this bug is not specific to _store_cache.

Any ideas?


-- 
Alexey Tourbin
ALT Linux Team

Attachment: pgpAY5gDrqIwF.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author