Index | Thread | Search

From:
Han Boetes <hboetes@gmail.com>
Subject:
Re: mg: Don't try to save *scratch* when there are no changes.
To:
Omar Polo <op@omarpolo.com>
Cc:
tech@openbsd.org
Date:
Mon, 2 Mar 2026 22:02:36 +0100

Download raw body.

Thread
On 3/2/26 9:50 PM, Omar Polo wrote:
> looks fine, but upon a closer look I realized that the similar check in
> buffsave() is now redundant.  there are only two callers:
> 
>  - filesave() which we are modifying, and
> 
>  - anycb() (in buffer.c) which attempts to write all buffers, but it
>    already has the (*bp->b_fname) != 0 and the BFCHG flag check to guard
>    it.
> 
> so, while we're here, I'd propose to also remove the BFCHG check from
> buffsave(), effectively "bubbling it up" to filesave().
> 
> what do you think?

Wonderful! You hit the nail on the head. It's a big improvement indeed.

BR
Han