From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7039 invoked by alias); 19 Jun 2015 14:23:38 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 35526 Received: (qmail 6292 invoked from network); 19 Jun 2015 14:23:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.0 From: Eric Cook To: zsh-workers@zsh.org Subject: [PATCH] _fc: prevent empty argument removal when expanding $history Date: Fri, 19 Jun 2015 10:23:24 -0400 Message-Id: <1434723804-22189-1-git-send-email-llua@gmx.com> X-Mailer: git-send-email 2.4.3 X-Provags-ID: V03:K0:f5TBX8GmQ84Li/IonKPuQR5AWnbuYyx72k8UbtR0Q+ZlOo+SMdd zxKzZtA8pKq1CQ0iN+lM5i7lYqOnJAFaxiK6oT03z85EhbEpEqUuP0CeEy3pXKyieaIC8k+ R/LUWlkhQsmX4QAjwX0ZpaYvd2jK0TT5OSYXhZjoIJ5dg6tOMPgu30UxR4olIqIlhSURz7z hT2kiuCEfzqZmq4QcgqNQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:XxjrxflBNA0=:4YZHuTBdfvH0KXeSdna7j7 oh+TECnpQ0kJ2YXi0llmhcWyRhMDZ1T49z+EQ2S2I2FPsg9muDDXzK40iCFq89kcCzfqVtHBF DmP0GVh3RiIlH3T7uxZy4saMQI73KEuvdBrsF+skUnqzOIlBdfv4gwLUzj/My8KURye6YRPqG 0hyV/N7kavPsyRuJCwgC3UKd5kv5L5D61NWSnnPVjfnf61wE39fXChZUi6kZXi1lFUh8jIU22 +Ffnkeh7B1HKSllYUMI/7aqKR5apYkd1lwNqEV9gWloP96XL4O8s6Vl2Yu7fsiWvAgRY2DWAv ILAp5m8/OANy4HaojyKxbaavcD+Dh47vO1/AMHAe2qGBY0fO7BWnOyzcXe4S1xn2Ia7PXbHeU ylqwnvfcTtBiRfQvehmgwaPbD9gpfU2vUYVQpHwxI7pWedfjBIA9hGRO5iF5R/BLP7JwzNGZK mj9jrFc3tCJw6KeCDQ6ux5BChsotDlGFwbIZGyKBI0IQa84Weub/0oN2Vod6V1RybY1jtqAE9 xfw1G7feIRwj1F26r804uvHPlL4oCnBvyAr4VRyO71XxcBefUsv3i6oA7+R5/ZJF4SkKSmP6P LDPhKzRnyuQRFoEFo4pwMybRpwIstjOzOvtciFqYxsN/Sn2yYfqdtl24prIO67OLzwXh4Kv98 6zhApEF1ScgdG4G/2RuSX+eaw1jiuoJdKAg8sIevm5pvNQQ== A few(thousand) errors flood my screen when completing history - _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