From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6108 invoked from network); 24 Jun 2021 08:36:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 24 Jun 2021 08:36:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624523797; b=OPIMITQDXETv5YcrxBGAZpFA0N31H5hV1uuCkDwGBinnPEZjB7t+LRjQgtMj779NqLlkET+Sqy S6yMQGZITKDr7bhgOe/fXqFRweUZ6dNHgtCJR96YU+T619zPPEVD+0Ol8GzMsy5r64zRwPjXZ5 vpPNKcPri0yg4mrGB8KpXGdbLo/UaXeMSIFqARtslrS4zTOS0PkPT2sV35zN9L6XB6ldGKGRh+ HkunP7q/laKhyIfzXTdC0mSLBaYgLzxqiWPrPTjN9cibmGSegA2lVIG11xPj1FoMGs36LtGRJO Jw2KRM+fwtg28Lr3vERJFESDwcjsqlr6yNurbSKKro6cGQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1624523797; bh=vZIuDL1445lUWADvH9/YapS+8oZkDMqu7+X+38hdqpg=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:DKIM-Signature; b=EiOvuYefOxtTsZugcsI2eKM9f/zb1rb2LvJYH6jc7l1dDmoair949cko9st86vPCicxhiZ1eci vpbOVuJF9zSZeabILnPiNnvbmIYGJFicmRvo+RdubCGTclfGsNwpbDb6pnaaURyN+vQMnPxvj0 OpMj8/UG24h/sy2oirpWmWw6KfJWniXB5oc2eVBatd7sowLc8DLlEv8SH93dyjXnOnQpoEb/7Y PUDdYgzffGCNnm/TCexj2ANqTeMVFJJRUJdoSyxmwXOA9hqNfbO8GfQcwuBr5RbCmCIWbTg2xB 9K1faahZE3l2s6Xua1jJiL/DvDTVs2gZ17fBKfyrhXc3QQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Subject:To:From:Date:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=5UdG1ewokdLJ163LgWXvtBbmDqMPBGUKBmIfWWCDsbU=; b=HnnCEksbnaE18Sf5PqtH1f5cVD s50jExzdOEj+GCnENxMnMlTY9r4284nDlmvJZ8EEWy2bwgJjCd3V70HDQWkXVlYRrKct9orY0cpZS 2IamR22v2hiTERerUeSSy6ZS4Z7Y7y5q2oykngd2kd73pKNYPq/qco6Z/M2nXzS28EqGQxs//xTuF ITqmKqxCzrCccA8GAN4qRZSkrbeUpxWXGJEt0eyDn9Gt81E2YUsqLrOdzufZ27goqQ8sSjskjfG0h Xx4TgZd5lPoqMFU+dGYlGeXUMIP/2Zjy+Zk2xU/5mQwklHgorXlxaIx96MemaK7hHTeA7ZOY4DGiI ZnI4X28Q==; Received: from authenticated user by zero.zsh.org with local id 1lwKqi-00006u-Qi; Thu, 24 Jun 2021 08:36:36 +0000 Authentication-Results: zsh.org; iprev=pass (joooj.vinc17.net) smtp.remote-ip=155.133.131.76; dmarc=none header.from=vinc17.net; arc=none Received: from joooj.vinc17.net ([155.133.131.76]:36994) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lwKqM-000Pp5-1R; Thu, 24 Jun 2021 08:36:14 +0000 Received: from smtp-zira.vinc17.net (128.119.75.86.rev.sfr.net [86.75.119.128]) by joooj.vinc17.net (Postfix) with ESMTPSA id 01EA346; Thu, 24 Jun 2021 10:36:12 +0200 (CEST) Received: by zira.vinc17.org (Postfix, from userid 1000) id B6806C226BB; Thu, 24 Jun 2021 10:36:12 +0200 (CEST) Date: Thu, 24 Jun 2021 10:36:12 +0200 From: Vincent Lefevre To: zsh-workers@zsh.org Subject: archived messages with "From " get truncated Message-ID: <20210624083612.GA170692@zira.vinc17.org> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Mailer-Info: https://www.vinc17.net/mutt/ User-Agent: Mutt/2.1+10 (5cc548e1) vl-138565 (2021-06-20) X-Seq: 49108 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Below is a message that was sent by Stephane to workers. It has been archived here: https://www.zsh.org/mla/workers/2021/msg01272.html but got truncated just before a line starting with "From ". It seems that the mail archive software is buggy, thinking that this starts a new mail message. In the archives, there is a risk that this message gets truncated in the forwarded message below, for the same reason. For those who read the archive, one has, with quotes to avoid the truncation: [...] > Why would one write print foo >&- in the first place, other than > to check whether print reports error or not (and in that regard, > the behaviour is very misleading) > > From looking at the history, it looks more like: > > 1990 (1.0) echo ignores write failures (by design or not). [...] ----- Forwarded message from Stephane Chazelas ----- Date: Wed, 9 Jun 2021 19:16:17 +0100 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: [BUG] builtin echo doesn't check write error 2021-06-09 09:13:42 -0700, Bart Schaefer: [...] > My (possibly poor) recollection is that this was made this way in part > for ports to environments that don't have a /dev/null device While that sounds like a very plausible reason for the original behaviour whereby "print" would not report any write error, that doesn't really tie up with the current behaviour where the error is supressed only when print/echo's stdout is explicitly closed. Why would one write print foo >&- in the first place, other than to check whether print reports error or not (and in that regard, the behaviour is very misleading) >From looking at the history, it looks more like: 1990 (1.0) echo ignores write failures (by design or not). 1999 workers/9129 Peter writes the "print foo >&-" succeeds, no error test case, just documenting the actual behaviour of print ignoring errors (here using >&- as the easiest way to trigger a write error). 2002 workers/16503 Clint adds some error messages upon write errors. 2002 workers/16556 we realise it breaks the test case above, so Bart removes the error message on EBADF for that test case to pass again. The fact that there's still an error message in (print)>&- looks like an oversight. The error in that case is output by execcmd_exec after print has returned as it tries to fflush stdout again,, not bin_print (you'll notice the error message doesn't mention "print"). 2011 workers/29845 Peter notices the error is displayed in (exec >&-; print) and adds a test case for it, but I'm not sure he correctly identified why. It very much looks like an (multiple) accident of implementation. POSIX does say that printf/echo should return with a non-zero exit status upon error, and stderr be used for diagnostix errors as usual. It's not clear to me if implementations are at liberty to decide whether a write() error is considered an error or not. In any case, it would be useful from an error point of view to be able to detect when writing fails. -- Stephane ----- End of forwarded message ----- -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)