Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Error in vi (or in man page)


On 2018/09/14 8:49, Paul Goyette wrote:
Current vi(1) man page says

     -r     Recover the specified files, or, if no files are specified,
            list the files that could be recovered.  If no recoverable
            files by the specified name exist, the file is edited as if
            the -r option had not been specified.

However, in actuality, if no recoverable files by the specified name
exist, vi simply reports that fact, and does nothing;  it does not
edit the file "as if the -r option had not been specified."

     #  ls kern_time_50.c
     # vi -r kern_time_50.c
     No files named kern_time_50.c, readable by you, to recover

POSIX says

If the -r option was specified, ... If no recovery information
about a file is available, an informational message to this effect
shall be written, and the edit shall proceed as usual.

This seems consistent with our manpage.

On the other hand, /usr/ucb/vi from Solaris 11 (based on Bill Joy's vi)
behaves strangely; if no recovery information is present, it allocate
an empty buffer even if there's a file of the specified name!

It would be better to fix our vi in accordance with POSIX. Thoughts?


Home | Main Index | Thread Index | Old Index