Castor Fu wrote: > On Fri, 18 Nov 2005, Dave Anderson wrote: > > > Dave Anderson wrote: > > > >> > >> Well, first off, it's kind of stupid to run the same .crashrc file twice, > >> isn't it? I shall fix that oversight henceforth... > > Yes, I suppose so, but I was actually seeing this first with > a local .crashrc... > Right -- you were seeing it when the local .crashrc *was* also $HOME/.crashrc. So it was executed twice, first as the $HOME version, and subsequently as the local version. > > >> > >> That leaves the case where "bt -O" is set in both the $HOME and > >> local .crashrc files. Whereas the local .crashrc is meant to override > >> whatever might be in the $HOME .crashrc, the "bt -O" case still wants > >> to be idempotent. That can be addressed by a little tinkering with cmd_bt(), > >> because the pc->flags will have RCHOME_IFILE or RCLOCAL_IFILE > >> set when it's executing those .crashrc commands. > >> > >> With those two fixes in hand, we can keep "bt -O" simple-minded. > > > > There's also the potential case of the command line "-i inputfile" option. > > But the initialization-time rule should still apply -- if "bt -O" is contained in > > any or all of the 3 possible initialization-time input files ($HOME/.crashrc, > > ./.crashrc, or "-i inputfile" files), the setting will remain idempotent. > > > > I also fixed the redundant running of $HOME/.crashrc and ./.crashrc > > files if they are the same file. > > Just so I understand, what you're saying is that if 'bt -O' is specified > in an initialization file, it always means 'use old' otherwise it's a toggle? Right -- it's only toggle-able during runtime. Dave