From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24264 invoked by alias); 23 Dec 2017 22:19:20 -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: 42162 Received: (qmail 6547 invoked by uid 1010); 23 Dec 2017 22:19:20 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f179.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.192.179):SA:0(-1.9/5.0):. Processed in 4.284509 secs); 23 Dec 2017 22:19:20 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: joeypabalinas@gmail.com X-Qmail-Scanner-Mime-Attachments: |signature.asc| X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=mN+EOJI9zQpCoVNnBIbeMkWwnNq76G2OJW4OK95dzfE=; b=gmQwfO56KwV99CdI1GK4dMQdUj7A8Y6elIlSaCiR0Do/G/HM0Zdb1ppLRQEuiyQ1pp /b9Q/ahoWBH+9YvRnpHB2msC1s0rnA8lq2PcMcFXj1GHPlA/rz9VKBZsGuYfRy4KUiEl OZmRTHqqeUb0N1SdIgEAZKOB85hxwN8T3I/xAfVMv/gAezocZwtajbZDNntsm7CAsd1q IXRmwZSMsm3REGKZhFJfmJZlJXPYM+6Gt7ARVW1nwvHCGqv4IS9Dg4iM8F6+caYu/yoY rKF9A6yCAK5STKm5PP4Wvuv0BRzQtOhkIXJIlI+8zwOA9FFmLYMKcUcX0lOUMVOJfQSw HjMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=mN+EOJI9zQpCoVNnBIbeMkWwnNq76G2OJW4OK95dzfE=; b=GwJMxXxTj/6eIVop0Xx4ZaCZz5DLevJWp960iRyDXmrDPWqToqdDH9J+BjvqeBSpRb YehjG0kG4WpUpdM1yYZLOdkjOAQBs81gAUaMn0iYc+/iMGTUfnTwvYoK6IieogGvpUxF EQrkzrR7cyW6yldgrswlv9zo5WvXy7Gtti/hJpsy1135iB1CRwnYAUjT0d5WuX6SircE WS6+KvrHHW4eH84eBGBn3x4hQN7i+gEvIpRzjDea2HFY2I1ZWFUyhOGz6jtgpJhYEyRL T61SYEFDLjbRMjXOvAN3C4Sw6JCn9f1LvJORwY70GrkNKpQAxmt91J14TQmPiv/tan5K dsSw== X-Gm-Message-State: AKGB3mID+36NOxSp2mXLbWCNmHLmpMEFRPxE6F6hv3ayKd4ucQgoXuKA KaFJUfNcjJJV4upP3F2eYBU= X-Google-Smtp-Source: ACJfBotvUTdlwQMPyHK7RC+j8uU9TCSLEQSvgAxxP+KufMYF5XFhNc536rHB3hB+Xdi5f+6gfybWGQ== X-Received: by 10.99.105.134 with SMTP id e128mr16173564pgc.152.1514067553061; Sat, 23 Dec 2017 14:19:13 -0800 (PST) Date: Sat, 23 Dec 2017 12:19:10 -1000 From: Joey Pabalinas To: psprint@zdharma.org Cc: zsh-workers@zsh.org, p.w.stephenson@ntlworld.com Subject: Re: Why sourcing a file is not faster than doing a loop with eval, zle -N Message-ID: <20171223221910.vmob22b7uosan5os@nibbler.alyptik.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ke75vqv5xv2cnb2m" Content-Disposition: inline User-Agent: NeoMutt/20171215 --ke75vqv5xv2cnb2m Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On December 23, 2017 3:01 PM, Sebastian Gniazdowski wrote: > We could do a pair of calls, first fgets(), then fgetc(), and this way > solve this problem? Wouldn't work because `fgets()` just returns the string as well as storing = it in the buffer instead of doing the _sane_ thing and returning the number of characters read. Because of that it's impossible to know if there are actua= lly any useful characters in our buffer past the first '\0' (if you tried to re= ad past that you would just be asking for a buffer overrun). Sadly, `fgets()` is of limited use for our purposes if the lines may have embedded '\0' characters. A possible alternative is something like POSIX `getline()` but I don't know if something like that would be kosher for Zsh. If it is, though, give a holler and I will cook up a patch. --=20 Joey Pabalinas --ke75vqv5xv2cnb2m Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKlZXrihdNOcUPZTNruvLfWhyVBkFAlo+1l4ACgkQruvLfWhy VBkfpA/+MNlOrurzanRrOT1zLO6lB2OlXucbYzEYbFiPK87XR5N8aVNq0VQuUI6c P4IB0k/gVGFpJ5Iq7H1frENVaDPwAdk5xY+Rz1LVeyIMm8O4BlUkvuZbGWeJeFKb rX2GfMURiECQrfkZt45vUokur4kAIveFmeH3Z9rTRyMueqIPVt+ElKEnJ9O7t7lX K65NQLUhLRNoT2noL6ZA1fGM2uafHvuaNPXWjKFh23iUJpa5Qo5QdZ5nbochJQYE wawacidfEIJ8590uppnr2bbDwbjinNNTHZQ4jMqQIbmoQ46mtwszWXh1kDZCOlVc 8KzkiGFWKS8mWyUTRHA5RJWRzjAbyIe714nV+ys4k2TwlOIry/OLFOdIgRtY/x0o NrMBOF6IkMLTHaeArrUmgZM/jswa24562KYKz/VJ1MZEGV3QeJcnCiW81UTIU6fP kXXLVrKwYFPeWb88u+xdnvafl61nzeZyfCWQBvF0Kj17ljaiHQ7F2pUsPRYHsa2M uxxzwOShMm8/q+NYGkWY2OicycYa5D/qu3VcjhKA6JuxO2P5fverEX8QyXgKySeu zOjsEdHuAtZ7J5AQenRoFfXPFqZqyP1N8dxXlI2o1YuX546KwUWvQSReBAVNH5c5 HH6GHRORW0aJbs5P3IoI7k1DL7FWRoCaLKRY+DIm58UIcv7U3o8= =dGtq -----END PGP SIGNATURE----- --ke75vqv5xv2cnb2m--