Email List: Xaustin-review-lX
[All Lists]

Defect in XCU ed

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XCU ed
From: Andrew Josey <yyyyyy@xxxxxxxxxxxxxxxxx>
Date: Tue, 11 Apr 2006 06:14:08 +0100
Organization: The Open Group
(this got misplaced in my inbox -- Andrew)

        Defect report from : William Toth , IBM Austin

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page XCU 340 line 13107 section ed objection {WLT-XCU-2}

Problem:

Edition of Specification (Year): 2004

Defect code :  1. Error

The current SUSv3 text for ed has the following wording, which was
supposed to have come from PASC 1003.2-92 #36 interpretation request.

If a terminal disconnect is detected:

 - If the buffer is not empty and has changed since the last write,
   the ed utility shall attempt to write a copy of the buffer to a 
   file named ed.hup in the current directory. If this write fails, 
   ed shall attempt to write a copy of the buffer to a filename 
   ed.hup in the directory named by the HOME environment variable. 
   If both these attempts fail, ed shall exit without saving the
   buffer.

 - The ed utility shall not write the file to the currently remembered
   pathname or return to command mode, and shall terminate with a 
   non-zero exit status.


If an end-of-file is detected on standard input:

 - If the ed utility is in input mode, ed shall terminate input mode
   and return to command mode.  It is unspecified if any partially 
   entered lines (that is, input text without a terminating 
   <newline>) are discarded from the input text.

 - If the ed utility is in command mode, it shall act as if a q
   command had been entered.


The text above ( and in POSIX.2b) is quite different from the changes
in the editors note in 1003.2-92 interp #36, which said:

"If an end-of-file is detected on standard input when input from the
user is expected and the standard input is a terminal device, if the
buffer is not empty and has changed since the last write, the ed utility
shall attempt to write a copy of the buffer to a file. First, the file
named ed.hup in the current directory shall be used; if that fails, the
file named ed.hup in the directory named by the HOME environment
variable shall be used.

 If an end-of-file is detected on standard input when input from the
user is expected and standard input is not a terminal device, the ed
utility shall not write the file to the currently remembered pathname
or return to command mode, and shall terminate with a nonzero exit
status."


The current wording requires ed to determine the difference between a
normal end of file and terminal disconnect when stdin sees an end of
file and stdin is a terminal. Whereas the original changes suggested
seem to be much more reasonable, just requiring differentiation if stdin
is a terminal.

Action:

Replace current text with the wording in the IR.

<Prev in Thread] Current Thread [Next in Thread>