[comp.mail.mush] Bug that bugs me

lmb@vicom.COM (Larry Blair) (05/07/89)

There is a very minor bug in mush that has been there from at least 6.1.
When I do a "mush -C -u news" and there is no mail for news, I get the
message:

/usr/spool/mail/news: No such file or directory<my shell prompt>

meaning, of course, that there is a missing "\n".  This bugs me because I
use ksh and if I then do a ESC k (so that I can change news to uucp), the
line has garbage at the end.

I figured that this would be a trivial fix.  I figured wrong.  After
not finding a string containing the message in the code, I went searching
and decided that even if I found it, it was probably used somewhere else
and adding the \n would screw it up.

Does someone have a patch for this?
-- 
Larry Blair   ames!vsi1!lmb   lmb@vicom.com

loverso@Xylogics.COM (John Robert LoVerso) (05/11/89)

In article <1709@vicom.COM> lmb@vicom.COM (Larry Blair) writes:
> There is a very minor bug in mush that has been there from at least 6.1.
> When I do a "mush -C -u news" and there is no mail for news, I get the
> message:
> 
> /usr/spool/mail/news: No such file or directory<my shell prompt>

The reason you can't find the "No such file..." message is because its
the text of ENOENT, not a string in mush.  This error message is generated
when switching to the specified folder, in the folder() command called from
Main().  folder() calls getpath() who returns the error string, and displays
the message as follows:

	tmp = getpath(newfolder, &n);
	if (n == -1) {
	    print("%s: %s\n", newfolder, tmp);
	    return -1;
	} else if (n == 1) {
	    print("%s: is a directory\n", tmp);
	    return -1;
	}

You'll notice the '\n' *is* included there.  The reason it gets "lost" is
that curses has already been initialized by this point, such that CRMOD has
already been turned off.  It might suffice to move the initialization of
curses to after all the initial processing (including selecting the folder).
However, some of that code looks fragile.  Perhaps mush should have a
routing for aborting that restores screen modes before printing the error
message.

-- 
John Robert LoVerso			Xylogics, Inc.  617/272-8140
loverso@Xylogics.COM			Annex Terminal Server Development Group
encore!xylogics!loverso			[formerly of Encore Computer Corp]

kent@happym.wa.com (Kent Forschmiedt) (05/11/89)

In article <1709@vicom.COM> lmb@vicom.COM (Larry Blair) writes:
>There is a very minor bug in mush that has been there from at least 6.1.
>When I do a "mush -C -u news" and there is no mail for news, I get the
>message:

>/usr/spool/mail/news: No such file or directory<my shell prompt>

> ...After
>not finding a string containing the message in the code, I went searching
>and decided that even if I found it, it was probably used somewhere else
>and adding the \n would screw it up.

Grep for sys_errlist; specifically, there is someplace that says 
something like:

fprintf(stderr, "%s: %s", progname, sys_errlist[errno]);

And it needs a newline.
-- 
 kent@happym.wa.com, tikal!camco!happym!kent, Happy Man Corp 206-282-9598

schaefer@ogccse.ogc.edu (Barton E. Schaefer) (05/12/89)

In article <1811@xenna.Xylogics.COM> loverso@Xylogics.COM (John Robert LoVerso) writes:
} In article <1709@vicom.COM> lmb@vicom.COM (Larry Blair) writes:
} > There is a very minor bug in mush that has been there from at least 6.1.
} > When I do a "mush -C -u news" and there is no mail for news, I get the
} > message:
} > 
} > /usr/spool/mail/news: No such file or directory<my shell prompt>
} 
} The reason you can't find the "No such file..." message is because its
} the text of ENOENT, not a string in mush.

[ Excerpt of code deleted ]

} You'll notice the '\n' *is* included there.  The reason it gets "lost" is
} that curses has already been initialized by this point, such that CRMOD has
} already been turned off.  It might suffice to move the initialization of
} curses to after all the initial processing (including selecting the folder).

The initialization code in main.c needs some reworking.  However, I hacked
a quick fix for this particular bug, which will be included in Official
Patch #2, coming Real Soon Now (like tonight or tomorrow).
-- 
Bart Schaefer       "And if you believe that, you'll believe anything."
							-- DangerMouse
CSNET / Internet                schaefer@cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer