zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH?] zsh/system module: sysread -o: Doc confusion?
Date: Mon, 25 Apr 2022 21:20:32 -0700	[thread overview]
Message-ID: <CAH+w=7bRr4gsFBE2NGr+C3x15oJhOoeCN5pTPABoOf1co2obDg@mail.gmail.com> (raw)

     If OUTFD is given, an attempt is made to write all the bytes just
     read to the file descriptor OUTFD.  If this fails, because of a
     system error other than EINTR or because of an internal zsh error
     during an interrupt, the bytes read but not written are stored in
     the parameter named by PARAM if supplied (no default is used in
     this case), and the number of bytes read but not written is stored
     in the parameter named by COUNTVAR if that is supplied.

Yet:
  sysread -t 1 -i 0 -c countvar -o 2 param
  zsh:sysread:1: no argument allowed with -o

I'm guessing we want the code to conform to the doc, and not the opposite?

diff --git a/Src/Modules/system.c b/Src/Modules/system.c
index 71745548f..ea11ef037 100644
--- a/Src/Modules/system.c
+++ b/Src/Modules/system.c
@@ -83,10 +83,6 @@ bin_sysread(char *nam, char **args, Options ops,
UNUSED(int func))

     /* -o: output file descriptor, else store in REPLY */
     if (OPT_ISSET(ops, 'o')) {
-    if (*args) {
-        zwarnnam(nam, "no argument allowed with -o");
-        return 1;
-    }
     outfd = getposint(OPT_ARG(ops, 'o'), nam);
     if (outfd < 0)
         return 1;


                 reply	other threads:[~2022-04-26  4:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7bRr4gsFBE2NGr+C3x15oJhOoeCN5pTPABoOf1co2obDg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).