Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH?] zsh/system module: sysread -o: Doc confusion?



     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;




Messages sorted by: Reverse Date, Date, Thread, Author