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

Bug#762673: emboss: FTBFS on hurd-i386



Source: emboss
Version: 6.6.0+dfsg-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hi,

Currently emboss fails to build from source due to usage of
PATH_MAX, which is not defined on GNU/Hurd. Only one file needs a
modification, see the attached path. This patch assumes getcwd(NULL,0)
works. Depending on for which systems this software is aimed at, a
configure.ac (.in here) check can be added. However, it seems that
upstream is not very active lately. This patch should work at least for
Debian supported OSes (libc4, libc5, glibc).

Thanks!
--- a/ajax/core/ajfile.c.orig	2013-07-15 23:25:29.000000000 +0200
+++ b/ajax/core/ajfile.c	2014-09-24 11:01:42.000000000 +0200
@@ -8574,9 +8574,9 @@
 
 const AjPStr ajFileValueCwd(void)
 {
-    char cwd[PATH_MAX+1];
+    char *cwd = getcwd(NULL,0);
 
-    if(!getcwd(cwd,PATH_MAX))
+    if(!cwd)
     {
         ajStrAssignClear(&fileCwd);
 
@@ -8589,6 +8589,7 @@
     if(!ajStrSuffixC(fileCwd, SLASH_STRING))
         ajStrAppendC(&fileCwd, SLASH_STRING);
 
+    free(cwd);
     return fileCwd;
 }
 

Reply to: