Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Very weird shell & sysread behavior
- X-seq: zsh-workers 43731
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Very weird shell & sysread behavior
- Date: Sat, 27 Oct 2018 22:53:21 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=ac3qkwSDm+DD/TCjJtFdmmmyIpEE73uJttTYQEt+aTo=; b=NJLl4upj588ubrnuqlXmU3B54tldq0fNiFFu9WxgFDBYYEPvBGSiEd5Am5qUJKKtcJ EEwpgmlmzCMPiWB1c9D7C02u/jUw2wAkja02KfC90Vl8EJFqS96pn0bwc6ZW/BOV6dXb 2bMFO2VG8pLGPPUO+JDxG6exqEtArM06jPmECNRNm6cZ1oPIsLhYv63vQ3LyouQln5lz 2F7s/w8i2pLCJj9bLK/ZbNFAT157eKjAluvyF3aljoFw7WHt06hqlrG+bRH1SaYg/RFX JgemfxKo+JgzWSOdeEwulf67j///99CYEHsMbleOSs9xMb/nGqyhxoor6w0vfK1S7utp Kp5Q==
- In-reply-to: <CAKc7PVBzb-7Hc0p6wBSmS8mTitnXo7X6j+m3_7QvRV1NgRnz1w@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVBzb-7Hc0p6wBSmS8mTitnXo7X6j+m3_7QvRV1NgRnz1w@mail.gmail.com>
Turned out the tricky output-parameter specifier, the '__tmp[(#__tmp +
1)]' isn't correct. Apparently because #__tmp in math context is
character-code. Regular __tmp_size variable and '__tmp[__tmp_size +
1]' works correctly, even when the data is printed in two print -r
instructions, not as the single string.
On Sat, 27 Oct 2018 at 22:35, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Hello,
> the screenshot says it all:
> http://psprint.blinkenshell.org/weird.png
>
> In the while loop, $__tmp[-1] returns correct data.
>
> After the loop, $__tmp[-1] nor $__tmp[@] contain any data.
>
> More: when I provide the data (on the writing end) in following way:
>
> print -r -- "${(q)ZTSMAP[colsearch_pattern]}"$'\0'
> print -nr -- "${(j::)${__zts_hcw_found[@]/(#e)/--${num}-del--}}"
>
> Then the issue occurs. But when I'll do it in following way:
>
> print -nr --
> "${(q)ZTSMAP[colsearch_pattern]}"$'\0'"${(j::)${__zts_hcw_found[@]/(#e)/--${num}-del--}}"
>
> I.e. through write of a single string – then the after-loop $__tmp
> references contain correct data. What's going on?
>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org
--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author