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

Re: Still problems with boot-floppies



Martin Schulze wrote:
> > I'm still having problems with boot-floppies wrt. pointerize.
> > 
> > Currently I'm trying the smallest example I could find:
> > 
> > 	utilities/dbootstrap/release_notes_test
> > 
> > To find the problem, set TESTLANG to something else than C or es.
> > 
> > I've done some debugging and saw that in boxes.c
> > 
> >         msg = _("Debian GNU/Linux System Installation");
> >         newtDrawRootText((w-strlen(msg))/2, -5, msg);
> > 
> > is called with msg==NULL.
> > 
> > The first line gets expanded to 
> > 
> >         msg = (translation[94]);
> > 
> > Since the installation routine must not crash with a segfault there
> > are now three possibilities to fix the problem:
> > 
> >  a) Fix newt to not crash when called with NULL strings
> > 
> >     Should be done anyway, will only move the problem.
> > 
> >  b) Add a MACRO around each incarnation of translation so it will
> >     contain an empty string instead of NULL
> > 
> >  c) Fix pointerize to prepare an array of empty strings instead
> >     of NULL.
> 
> Err, forgot the fourth one:
> 
>    d) Make pointerize return the original string if no translation
>       was found.


At least one cause of problems is that some tools (like strlen() for
example) are failing on NULL pointers.  It's not that the NULL-string
gets to newt, the system crashes before that.

Thus, pointerize must NOT return any NULL pointer or we need to
check for NULL pointers on our own.  This would be silly as it 
would mean that we would have to include all strings in the source
again - one reason why pointerize was inveneted, I guess.

Instead of

         msg = (translation[94]);

we would have to use

         msg = (translation[94])?translation[94]:"The original string";

Thus: The only proper fix for this would be to get pointerize act
like gettext.  This means that if a string is not found in the database,
return the untranslated string.  This requires some major hacking of
pointerize which I wasn't able to last I tried to.

Volunteers welcome.

Regards,

	Joey

-- 
No question is too silly to ask, but, of course, some are too silly
to answer.   -- Perl book

Please always Cc to me when replying to me on the lists.


Reply to: