Re: Bug#725218: sed: FTBFS, missing PATH_MAX on hurd

Samuel Thibault <[email protected]>
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <20140209171148.GA32636__11693.3060613976$1391972200$gmane$org@type.wlan.youpi.perso.aquilenet.fr>
Hello,

Here is a backport of the fix for the debian package, could you upload
it?

Thanks,
Samuel
path_max (text/plain, 2.6 KB)
commit 7bb8d35d0330161a5af5341471d0c183a067e8c2
Author: Jose E. Marchesi <[email protected]>
Date:   Sun Oct 6 14:43:38 2013 +0200

    Set PATH_MAX to some constant in case it is not defined in system
    headers.
    
    2013-10-06  Jose E. Marchesi  <[email protected]>
    
    	* basicdefs.h (PATH_MAX): Defined to some constant in case it is
    	not defined by system headers.
    	* sed/utils.c: Do not include pathmax.h anymore.
    	* bootstrap.conf (gnulib_modules): Do not use the gnulib module
    	pathmax.

diff --git a/basicdefs.h b/basicdefs.h
index 0d28a97..09f5beb 100644
--- a/basicdefs.h
+++ b/basicdefs.h
@@ -1,5 +1,6 @@
 /*  GNU SED, a batch stream editor.
-    Copyright (C) 1998, 1999, 2002, 2003, 2010 Free Software Foundation, Inc.
+    Copyright (C) 1998, 1999, 2002, 2003, 2010, 2013
+    Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -40,6 +41,13 @@ typedef unsigned long countT;
 #define obstack_chunk_alloc  ck_malloc
 #define obstack_chunk_free   free
 
+/* MAX_PATH is not defined in some platforms, most notably GNU/Hurd.
+   In that case we define it here to some constant.  Note however that
+   this relies in the fact that sed does reallocation if a buffer
+   needs to be larger than PATH_MAX.  */
+#ifndef PATH_MAX
+# define PATH_MAX 200
+#endif
 
 /* handle misdesigned <ctype.h> macros (snarfed from lib/regex.c) */
 /* Jim Meyering writes:
diff --git a/bootstrap.conf b/bootstrap.conf
index 48ab2aa..dc64da9 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -19,7 +19,7 @@
 # gnulib modules used by this package.
 gnulib_modules="
     acl alloca btowc c-ctype extensions fwriting getdelim getopt gettext-h
-    localcharset mbrlen mbrtowc mbsinit memchr mkostemp obstack pathmax regex
+    localcharset mbrlen mbrtowc mbsinit memchr mkostemp obstack regex
     rename selinux-h stdbool stat-macros ssize_t strerror strverscmp
     unlocked-io verify version-etc-fsf wcrtomb wctob"
 
diff --git a/sed/utils.c b/sed/utils.c
index aa674fd..0a53511 100644
--- a/sed/utils.c
+++ b/sed/utils.c
@@ -1,5 +1,5 @@
 /*  Functions from hack's utils library.
-    Copyright (C) 1989, 1990, 1991, 1998, 1999, 2003, 2008, 2009, 2011
+    Copyright (C) 1989, 1990, 1991, 1998, 1999, 2003, 2008, 2009, 2011, 2013
     Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,6 @@
 #include <limits.h>
 
 #include "utils.h"
-#include "pathmax.h"
 #include "fwriting.h"
 
 const char *myname;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.