Re: abiword: FTBFS on hurd-i386
On Thu, 2011-11-10 at 17:13 +0100, Guillem Jover wrote:
> Hi!
>
> On Wed, 2011-11-09 at 18:15:50 +0100, Svante Signell wrote:
> > diff -ur abiword-2.9.1/src/af/xap/gtk/xap_UnixApp.cpp abiword-2.9.1.modified/src/af/xap/gtk/xap_UnixApp.cpp
> > --- abiword-2.9.1/src/af/xap/gtk/xap_UnixApp.cpp 2011-05-09 09:32:28.000000000 +0200
> > +++ abiword-2.9.1.modified/src/af/xap/gtk/xap_UnixApp.cpp 2011-11-09 15:58:06.000000000 +0100
> > @@ -271,12 +271,13 @@
> > {
> > // FIXME: this code sucks hard
> >
> > - char buf[PATH_MAX];
> > + char * buf = NULL;
> >
> > // see if ABIWORD_DATADIR was set in the environment
> > const char * sz = getenv("ABIWORD_DATADIR");
> > if (sz && *sz)
> > {
> > + buf = (gchar *)g_malloc(strlen(sz)+1);
> > strcpy(buf,sz);
> > char * p = buf;
> > int len = strlen(p);
>
> You could either use g_strdup() or rearrange the code to reuse len
> instead of doing strlen(sz) twice.
Yes, that would be more efficient of course. I'll submit a new patch if
the maintainer wishes. No response yet from that side.
BTW: Abiword works fine under GNU/Hurd!
Reply to: