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

Bug#648153: abiword: FTBFS on hurd-i386



Package: abiword
Version: 2.9.1-0.1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hi,

the attached tiny patch solves the FTBFS problems of abiword on
GNU/Hurd. In the first path config.h is included to make possible to
check if TOOLKIT_GTK is defined. The second part use dynamic memory
allocation to avoid the absence of a PATH_MAX definition for GNU/Hurd.
The patch has been tested with a small program on GNU/Linux and
GNU/Hurd.

Thanks!
diff -ur abiword-2.9.1/src/af/util/xp/ut_path.h abiword-2.9.1.modified/src/af/util/xp/ut_path.h
--- abiword-2.9.1/src/af/util/xp/ut_path.h	2009-12-13 10:45:47.000000000 +0100
+++ abiword-2.9.1.modified/src/af/util/xp/ut_path.h	2011-11-09 09:26:11.000000000 +0100
@@ -29,6 +29,8 @@
 #include <limits.h>
 #endif
 
+#include "config.h"
+
 /* GTK build supports platforms without PATH_MAX; we leave the warning in for
  * other platforms to avoid headaches
  */
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-08 20:43:26.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 = (char *)malloc(strlen(sz)+1);
 		strcpy(buf,sz);
 		char * p = buf;
 		int len = strlen(p);
@@ -290,12 +291,14 @@
 		if (p[len-1]=='/')				// trim trailing slash
 			p[len-1] = 0;
 		XAP_App::_setAbiSuiteLibDir(p);
+		free(buf);
 		return;
 	}
 
 	// otherwise, use the hard-coded value
 	XAP_App::_setAbiSuiteLibDir(getAbiSuiteHome());
 
+	free(buf);
 	return;
 }
 

Reply to: