zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH?] zsh/system module: sysread -o: Doc confusion?
@ 2022-04-26  4:20 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2022-04-26  4:20 UTC (permalink / raw)
  To: Zsh hackers list

     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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-26  4:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26  4:20 [PATCH?] zsh/system module: sysread -o: Doc confusion? Bart Schaefer

Code repositories for project(s) associated with this 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).