On Wed, 2012-01-18 at 10:52 +0100, Svante Signell wrote:
> reopen 648153
> thanks

Since the bug has been reopened, attached is an updated patch
fix_FTBFS4Hurd.patch, reducing the computation of len = strlen(sz) to
once, instead of twice. With this patch, and the updated debian/rules
abiword build fine on GNU/Hurd :-)

Thanks!
diff -ur abiword-2.9.2/src/af/util/xp/ut_path.h abiword-2.9.2.modified/src/af/util/xp/ut_path.h
--- abiword-2.9.2/src/af/util/xp/ut_path.h	2011-11-08 18:53:10.000000000 +0100
+++ abiword-2.9.2.modified/src/af/util/xp/ut_path.h	2012-01-18 17:33:23.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.2/src/af/xap/gtk/xap_UnixApp.cpp abiword-2.9.2.modified/src/af/xap/gtk/xap_UnixApp.cpp
--- abiword-2.9.2/src/af/xap/gtk/xap_UnixApp.cpp	2011-11-12 15:48:22.000000000 +0100
+++ abiword-2.9.2.modified/src/af/xap/gtk/xap_UnixApp.cpp	2012-01-18 17:38:06.000000000 +0100
@@ -258,15 +258,16 @@
 {
 	// 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)
 	{
+		int len = strlen(sz);
+		buf = (gchar *)g_malloc(len+1);
 		strcpy(buf,sz);
 		char * p = buf;
-		int len = strlen(p);
 		if ( (p[0]=='"') && (p[len-1]=='"') )
 		{
 			// trim leading and trailing DQUOTES
@@ -277,6 +278,7 @@
 		if (p[len-1]=='/')				// trim trailing slash
 			p[len-1] = 0;
 		XAP_App::_setAbiSuiteLibDir(p);
+		g_free(buf);
 		return;
 	}
 

Reply via email to