bug-bash
[Top][All Lists]
Advanced

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

Re: Bash mailcheck bug


From: Rick Richardson
Subject: Re: Bash mailcheck bug
Date: Thu, 20 Dec 2001 14:59:02 -0600
User-agent: Mutt/1.2.5i

On Thu, Dec 20, 2001 at 02:47:40PM -0600, Rick Richardson wrote:
> 
> Chet:
> 
> After years of waiting for bash to be able to run my Korn shell
> aliases properly, I finally bit the bullet and switched my login
> shells to bash2.
> 
> Everything has been fine, except that every time I get email, bash
> notifies me on every single xterm the next time I hit enter.  This
> could be hours after I have read the email with bash.  This never
> happened to me with Korn shell.  I'd get the notification on
> one xterm, read the mail with mutt, and then none of my other
> xterm sessions would bug me about it.
> 
> I finally couldn't stand it anymore, so I went into the source code.
> Here's the problem code:
> 
>           /* If the user has just run a program which manipulates the
>              mail file, then don't bother explaining that the mail
>              file has been manipulated.  Since some systems don't change
>              the access time to be equal to the modification time when
>              the mail in the file is manipulated, check the size also.  If
>              the file has not grown, continue. */
>           if ((atime >= mtime) && !file_is_bigger)
>             continue;
> 
> Well, even though the atime is greater than the mtime after I've read
> the mail with mutt, the file will always be bigger because, except for
> spam, I *never* delete or file my email.  Email stays in my incoming
> box right where it will be staring me in the face for easy reference
> or to remind me that I have to do something.
> 
> It seems to me that the logic really ought to be just a simple:
> 
>           if (atime >= mtime)
>             continue;
> 
> Possibly, you might want to add a new option that some people (though
> I can't think who) might want to set which says to keep nagging you if
> the mail file is bigger.


Duh!  I just realized this is a coding bug.  Shouldn't the line read:

           if ((atime >= mtime) || !file_is_bigger)
             continue;

Then it even matches the comments.

-Rick

-- 
Rick Richardson  rickr@mn.rr.com      http://home.mn.rr.com/richardsons/
Twin Cities traffic animations are at http://tctraffic.0catch.com/

"My, my, I'm late for my bridge club."  "Gee, mom, isn't that bridge
built yet?"  "No, son, and it won't be until both sides of the big ditch
can press the same button at the same time."  -The Firesign Theater



reply via email to

[Prev in Thread] Current Thread [Next in Thread]