[26255] in Source-Commits

home help back first fref pref prev next nref lref last post

Re: /svn/athena r25472 - in trunk/third/moira: clients/mailmaint

daemon@ATHENA.MIT.EDU (Geoffrey Thomas)
Thu May 3 16:22:57 2012

Date: Thu, 3 May 2012 13:22:55 -0700 (PDT)
From: Geoffrey Thomas <geofft@MIT.EDU>
To: Jonathan Reed <jdreed@MIT.EDU>
cc: Greg Hudson <ghudson@MIT.EDU>, source-commits@MIT.EDU
In-Reply-To: <1F2ED255-1893-432A-9226-7F590A12DCA8@mit.edu>
Message-ID: <alpine.DEB.2.00.1205031321150.2871@dr-wily.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

I'm assuming it was originally written that way because the author of the 
code didn't realize com_err was printf-y (as evidenced by every other 
change you needed to make).

Anyway, ACk and thanks. Quilt would be more robust to our daorig process, 
but I'm not going to insist on it right yet. (If we start thinking about 
source format 3, we'll want to switch.)

-- 
Geoffrey Thomas
geofft@mit.edu

On Thu, 3 May 2012, Jonathan Reed wrote:

>
> On May 3, 2012, at 3:59 PM, Greg Hudson wrote:
>
>> On 05/03/2012 03:55 PM, Jonathan Reed wrote:
>>> I'm not sure what you're objecting to, or what your alternative suggesting for fixing the error is.  I may well be wrong, but this is unclear.
>>
>> I will translate from C nerd.
>>
>>>>> -	    com_err(program_name, status, "\nPress [RETURN] to continue");
>>>>> +	    com_err(program_name, status, "%s", "\nPress [RETURN] to continue");
>>>> Huh?
>>
>> "This is a literal string.  You shouldn't need to change it, should you?"
>
> Indeed not.  And it works as originally written.  I must have misread a line number or something.  I will revert it.
>
>
>>
>>>>>     sprintf(input, "Cannot open input file %s", argv[1]);
>>>>> -      com_err("moira (script)", 0, input);
>>>>> +      com_err("moira (script)", 0, "%s", input);
>>>> This seems a little redundant...
>>
>> "Wouldn't it be better to eliminate the snprintf() call by bringing its
>> format string down into the com_err() call?"
>
> Probably.  I assume no one can think of a reason why it wasn't just written that way in the first place?   My goal here was to make it build, not necessarily to fix other inefficiencies, but I suppose there's no reason I can't do both.
>
> -Jon

home help back first fref pref prev next nref lref last post