pspp-dev
[Top][All Lists]
Advanced

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

Re: Value labels


From: Ben Pfaff
Subject: Re: Value labels
Date: Sat, 04 Dec 2010 11:11:04 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

John Darrington <address@hidden> writes:

> On Tue, Nov 30, 2010 at 08:37:21PM -0800, Ben Pfaff wrote:
>      
>      It looks like the code just hasn't caught up to the
>      documentation.  Here's a patch.  If no one has objections then
>      I'll push this out to "master" when Savannah comes back up.
>      
> I think the git repos are up now.
>      
>      +      if (ds_length (&label) > 255)
>               {
>      +          msg (SW, _("Truncating value label to 255 bytes."));
>      +          ds_truncate (&label, 255);
>               }
>
> For code like that, I would have defined a const int max_label_length=255;
> and used it in each of the three places.  This has at least two advantages:
> a) less chance of a cut and paste error; b) Next year when we increase the 
> length to 512, the translatable string remains unchanged, thus avoiding 
> creating a nuisance for all the translators.

You make a good point.  If we change it once, we might change it
again later.

I added that improvement and pushed this patch.
-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

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