zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] _fc: prevent empty argument removal when expanding $history
@ 2015-06-19 14:23 Eric Cook
  2015-06-20  5:11 ` Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Cook @ 2015-06-19 14:23 UTC (permalink / raw)
  To: zsh-workers

A few(thousand) errors flood my screen when completing history -<tab>

_fc:79: division by zero
_fc:79: bad math expression: operator expected at `0 signal.h'
_fc:79: lvalue required
_fc:79: bad math expression: operator expected at `$$'
_fc:79: bad math expression: operator expected at `14346'
_fc:79: bad math expression: operator expected at `zshbuiltin...'
_fc:79: bad math expression: illegal character: '
_fc:79: bad math expression: operand expected at `)'
_fc:79: ')' expected

Due to my HISTFILE having this entry:
: 1431102567:0;

(i don't know why it is there either)
---
 Completion/Zsh/Command/_fc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Completion/Zsh/Command/_fc b/Completion/Zsh/Command/_fc
index 1589244..13f2422 100644
--- a/Completion/Zsh/Command/_fc
+++ b/Completion/Zsh/Command/_fc
@@ -75,7 +75,7 @@ if [[ -n $state ]]; then
     _wanted -2V events expl "$state_descr" compadd -M "B:0=" -ld list - \
         "${events[@]%%:*}"
   elif [[ -prefix - ]]; then
-    for num cmd in ${(kv)history}; do
+    for num cmd in "${(@kv)history}"; do
       (( num=num - HISTNO ))
       events+=( $num:$cmd )
     done
-- 
2.4.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] _fc: prevent empty argument removal when expanding $history
  2015-06-19 14:23 [PATCH] _fc: prevent empty argument removal when expanding $history Eric Cook
@ 2015-06-20  5:11 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2015-06-20  5:11 UTC (permalink / raw)
  To: Eric Cook; +Cc: zsh workers

On Fri, Jun 19, 2015 at 4:23 PM, Eric Cook <llua@gmx.com> wrote:
> A few(thousand) errors flood my screen when completing history -<tab>
>
> _fc:79: division by zero
> _fc:79: bad math expression: operator expected at `0 signal.h'
> _fc:79: lvalue required
> _fc:79: bad math expression: operator expected at `$$'
> _fc:79: bad math expression: operator expected at `14346'
> _fc:79: bad math expression: operator expected at `zshbuiltin...'
> _fc:79: bad math expression: illegal character: '
> _fc:79: bad math expression: operand expected at `)'
> _fc:79: ')' expected
>
> Due to my HISTFILE having this entry:
> : 1431102567:0;
>
> (i don't know why it is there either)

Looks like Oliver fixed this in passing in 35527.

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-20  5:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 14:23 [PATCH] _fc: prevent empty argument removal when expanding $history Eric Cook
2015-06-20  5:11 ` Mikael Magnusson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).