A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1786 ====================================================================== Reported By: eblake Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1786 Category: Shell and Utilities Type: Clarification Requested Severity: Objection Priority: normal Status: New Name: Eric Blake Organization: Red Hat User Reference: ebb.ed Section: XCU ed Page Number: 2801 Line Number: 92899 Final Accepted Text: ====================================================================== Date Submitted: 2023-11-02 15:13 UTC Last Modified: 2023-11-13 17:31 UTC ====================================================================== Summary: ed behavior on non-existing filename ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- related to 0000251 Forbid newline, or even bytes 1 through... ======================================================================
---------------------------------------------------------------------- (0006567) geoffclare (manager) - 2023-11-13 17:31 https://austingroupbugs.net/view.php?id=1786#c6567 ---------------------------------------------------------------------- On page 2797 line 92714 section ed ASYNCHRONOUS EVENTS, change: <blockquote>If the buffer is not empty and has changed since the last write, the</blockquote>to:<blockquote>If the buffer is not empty and the buffer change flag is set (see the EXTENDED DESCRIPTION section), the</blockquote> On page 2797 line 92725 section ed STDERR, change:<blockquote>The standard error shall be used only for diagnostic messages.</blockquote>to: <blockquote>The standard error shall be used for diagnostic messages and may be used for warning messages.</blockquote> On page 2797 line 92730 section ed EXTENDED DESCRIPTION, after:<blockquote>The <i>ed</i> utility shall operate on a copy of the file it is editing; changes made to the copy shall have no effect on the file until a <b>w</b> (write) command is given. The copy of the text is called the <i>buffer</i>.</blockquote>add these sentences:<blockquote>The <i>ed</i> utility shall keep track of whether the buffer has been modified. This shall be maintained as if via an internal flag which is set by any command that modifies the buffer and is cleared by an <b>e</b> or <b>E</b> command that reloads (or empties) the buffer, or a <b>w</b> command that writes the entire buffer. A command that makes changes to the buffer in such a way that its contents are the same after the command (for example <b>s/a/a/</b>) shall be considered to have modified the buffer, unless explicitly stated otherwise. In the remainder of the description, this flag is referred to as the <i>buffer change flag</i>.</blockquote> On page 2800 line 92839 section ed EXTENDED DESCRIPTION, change:<blockquote>If changes have been made in the buffer since the last w command that wrote the entire buffer</blockquote>to:<blockquote>If the buffer change flag is set</blockquote> On page 2800 line 92845, change:<blockquote>If the <b>e</b> or <b>q</b> command is repeated with no intervening command, it shall take effect.</blockquote>to:<blockquote>If another <b>e</b> or <b>q</b> command is then attempted with no intervening command that sets the buffer change flag, it shall take effect.</blockquote> On page 2801 line 92881, in the Append Command text, add a sentence:<blockquote>If <text> is empty (that is, the terminating '.' immediately follows the 'a'), the buffer change flag shall not be set.</blockquote> On page 2801 line 92901, in the Edit Command text, after the sentence:<blockquote>If no pathname is given, the currently remembered pathname, if any, shall be used (see the f command).</blockquote>insert another sentence:<blockquote>If the pathname names a file that does not exist and the buffer change flag is clear, it is unspecified whether this is treated as an error, or whether the resulting buffer is emptied and a warning is written to standard error instead of writing the byte count to standard out.</blockquote> On page 2801 line 92909, in the Edit Command text, change:<blockquote>If the buffer has changed since the last time the entire buffer was written</blockquote>to:<blockquote>If the buffer change flag is set</blockquote> On page 2802 line 92914, in the Edit Without Checking Command text, change:<blockquote>shall not check to see whether any changes have been made to the buffer since the last <b>w</b> command.</blockquote>to:<blockquote>shall not check to see whether the buffer change flag is set.</blockquote> On page 2802 line 92918, in the Filename Command text, change:<blockquote>If <i>file</i> is given, the <b>f</b> command shall change the currently remembered pathname to <i>file</i>;</blockquote>to:<blockquote>If <i>file</i> is given, the <b>f</b> command shall change the currently remembered pathname to <i>file</i>, whether or not <i>file</i> names an existing file;</blockquote> On page 2803 line 92977, in the Insert Command text, add a sentence:<blockquote>If <text> is empty (that is, the terminating '.' immediately follows the 'i'), the buffer change flag shall not be set.</blockquote> On page 2805 Read Command, add a new paragraph at the end (after line 93044):<blockquote>If the number of bytes read is 0 it is unspecified if the buffer change flag is set.</blockquote> On page 2805 line 93027, in the Quit Command text, change:<blockquote>If the buffer has changed since the last time the entire buffer was written</blockquote>to:<blockquote>If the buffer change flag is set</blockquote> On page 2805 line 93031, in the Quit Without Checking Command text, change:<blockquote>without checking whether changes have been made in the buffer since the last <i>w</i> command</blockquote>to:<blockquote>without checking whether the buffer change flag is set</blockquote> On page 2807 line 93120, in the Write Command text, change:<blockquote>This usage of the write command with '!' shall not be considered as a ``last <b>w</b> command that wrote the entire buffer'', as described previously; thus, this alone ...</blockquote>to:<blockquote>This usage of the <b>w</b> command with '!' shall not clear the buffer change flag; thus, this alone ...</blockquote> Issue History Date Modified Username Field Change ====================================================================== 2023-11-02 15:13 eblake New Issue 2023-11-02 15:13 eblake Name => Eric Blake 2023-11-02 15:13 eblake Organization => Red Hat 2023-11-02 15:13 eblake User Reference => ebb.ed 2023-11-02 15:13 eblake Section => XCU ed 2023-11-02 15:13 eblake Page Number => 2801 2023-11-02 15:13 eblake Line Number => 92899 2023-11-02 15:16 eblake Relationship added related to 0000251 2023-11-02 15:18 eblake Description Updated 2023-11-02 15:18 eblake Desired Action Updated 2023-11-13 17:31 geoffclare Note Added: 0006567 ======================================================================
