Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in csh (affecting vi)

0 views
Skip to first unread message

ucf-cs!lantz

unread,
Apr 5, 1983, 9:35:32 PM4/5/83
to
There was a report in unix-wizards of a "bug in vi" which caused it to
give a "Too many file names" error, if a file name was given in a :e
command which contained an asterisk, even if only one file name matched.
The same error occurs if the filename starts with a tilde.

This was correctly found by Scott Bradner at Harvard University to be
caused by the fact that csh, which is used by vi to expand the filename,
was printing its prompt in addition to the filename. I had also found
this prompt annoying when other programs, such as Franz Lisp, invoke the
shell to execute one command.

Bradner's correction was not exactly what was called for, however. The csh
has a flag 'prompt' which is true if the shell is supposed to prompt for
input. This flag is set by default, and is reset by certain flags, including
the -c flag, which is the one used by vi and Franz Lisp. The problem is
that THIS FLAG IS NOT CHECKED by the shell before it prints a prompt! The
check goes in the routine process, in sh.c. Diffs follow.

Philip Lantz
duke!ucf-cs!lantz

*** sh.c.old Mon Apr 4 22:33:47 1983
--- sh.c Mon Apr 4 22:33:31 1983
***************
*** 669,673
if (neednote)
pnote();

! if (intty && evalvec == 0) {
mailchk();

--- 669,674 -----
if (neednote)
pnote();

! /* Check of prompt added by PRL, UCF, April 1983. */
! if (intty && prompt && evalvec == 0) {
mailchk();

mhb5b!smb

unread,
Apr 5, 1983, 11:49:50 PM4/5/83
to
My experience is that the alleged bug in csh (that it prints the prompt
when it shouldn't, thereby affecting file-name expansion from 'vi' and
'ucbmail') isn't a bug; rather, many people unconditionally set 'prompt'
in their .cshrc files. It should only be set if it's already set to
something:

if ($?prompt) set prompt='MyPrompt '

0 new messages