From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43736-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 6b6372eb for ; Sun, 28 Oct 2018 12:00:09 +0000 (UTC) Received: (qmail 15947 invoked by alias); 28 Oct 2018 11:59:59 -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: List-Unsubscribe: X-Seq: 43736 Received: (qmail 24926 invoked by uid 1010); 28 Oct 2018 11:59:59 -0000 X-Qmail-Scanner-Diagnostics: from mail-ot1-f48.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.210.48):SA:0(-2.0/5.0):. Processed in 1.293352 secs); 28 Oct 2018 11:59:59 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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 :cc:content-transfer-encoding; bh=SUVsngv/AEPbsfGbYegRQbBqj9oKHBsY4XdP5QaMg0k=; b=FjfwdN0hmQL4nSOComu+uqDuUXfJntwdSUx/FArZvHk4ztvIq14BxMyGn7K698PjrI Xw+r5RQB+bbNRQh5hAZtuwmzJYb3M+XdP/z/8Tok59G9TxtDPAZKUvw/yo2JLS13vnZm i2Ep+FES7ZihrjCC9gwSfIzrPBdqkRcu1I+k6CNtJ3IT+ZZ0uM1pPKMIfqg1eQOsSgTt W3TMCwbPmR6chW4Y10KKhIHS3EJ53R/fP0GbVr+nDM1viIJBRPH7XJGqa/wBZMos9QrB kyRfZ1/uQnWjgLuCnxDsN7a5+9Gil6Ry7lWAMyMklfxStZueuVZc5WmEDIy4OvshwfLT rG5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SUVsngv/AEPbsfGbYegRQbBqj9oKHBsY4XdP5QaMg0k=; b=mFirJ2h/8X5Skua2CaO0iythkL9lYIb+NKOC6GCq7q7rzclnDmZt1/Iu2E0UsODuH6 4LruJEy5at0Ruc4ROxIp3+f3MEKtJtWKIqduHS28mXxqan8Ip37mp+f/gOBJSAY6JOd7 ZmVQ4FIZvim4HOZ4q2HhO8vQHcrUFw76JAVn5TT0m2kMrxnOKSlaGBBGNkfzmBV+7Ibf N8Ev4ZSy3QKPL6TEO9OczCVOIjsnyMIx3AoxZMdY6gcoUH3NIo4fvpN9+Ij64sbQ2XcZ QS/wzFz/96J0QOln8bYpkK7xAQ9kvcFIKGHLvCvgIuck0GIkyxJWklozMmOfMxILhhKs RDIw== X-Gm-Message-State: AGRZ1gJ3cGVvS3Z5vFsJlt4avVPg+BIjRQjsiberhqWiK/LWjU9kcs9m zME6VMzv3ghmTJN3Nv6l9G9d3so0FEnh0j6z4kVrmz2r X-Google-Smtp-Source: AJdET5e+F2/0JSI5mofaDxrqWlcaqpvbw3cotXNqUXZ+blPUdxY82X+EOu1xWAODaD7GtqrqEiZpKxy0PbdI+z1wiEU= X-Received: by 2002:a9d:3cbd:: with SMTP id z58mr6588000otc.159.1540727996121; Sun, 28 Oct 2018 04:59:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sun, 28 Oct 2018 12:59:44 +0100 Message-ID: Subject: Re: Very weird shell & sysread behavior To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 28 Oct 2018 at 06:22, Bart Schaefer wro= te: > > On Sat, Oct 27, 2018 at 1:53 PM Sebastian Gniazdowski > wrote: > > > > 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. > > You could also do __tmp[$#__tmp+1] if you want to avoid the extra variabl= e. Thanks, didn't try this. The extra variable has additional positive effect =E2=80=93 when increased for each 0 return from sysread, it doesn't compute array length each read. But for 65kB reads, it probably doesn't matter, as there will not be many of reads at all (to exhaust the input FD). Blinkenshell isn't responding, a more permanent and responsive link: https://imgur.com/YGWYTLe --=20 Sebastian Gniazdowski News: https://twitter.com/ZdharmaI IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin Blog: http://zdharma.org