[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
realpath(path,NULL)
From: |
Bruno Haible |
Subject: |
realpath(path,NULL) |
Date: |
Wed, 11 May 2011 13:41:18 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Jim,
It was reported in <https://savannah.gnu.org/bugs/?33273> that the test program
of canonicalize.m4 leads to a crash and a dialog box while running 'configure'
on MacOS X 10.4.
Actually I reproduce it also on MacOS X 10.5, FreeBSD 6.4, OpenBSD 4.4 with
this small test program:
==============================================================
#include <stdlib.h>
int
main ()
{
char *name1 = realpath ("conftest.a", NULL);
char *name2 = realpath ("conftest.b/../conftest.a", NULL);
char *name3 = realpath ("conftest.a/", NULL);
return !(name1 && *name1 == '/' && !name2 && !name3);
}
===============================================================
Here is a proposed fix:
2011-05-11 Bruno Haible <address@hidden>
canonicalize, canonicalize-lgpl: Avoid crash dialog on MacOS X.
* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Add GL_NOCRASH code.
* modules/canonicalize (Depends-on): Add 'nocrash'.
* modules/canonicalize-lgpl (Depends-on): Likewise.
* doc/posix-functions/realpath.texi: Update platforms list.
Reported by Ryan Schmidt <address@hidden>.
--- doc/posix-functions/realpath.texi.orig Wed May 11 13:38:39 2011
+++ doc/posix-functions/realpath.texi Wed May 11 13:28:13 2011
@@ -14,7 +14,7 @@
@item
This function does not allow for a NULL @samp{resolved} parameter on
some platforms:
-Solaris 10.
+MacOS X 10.5, FreeBSD 6.4, OpenBSD 4.4, Solaris 10.
@item
This function does not always return an absolute path on some
platforms:
--- m4/canonicalize.m4.orig Wed May 11 13:38:39 2011
+++ m4/canonicalize.m4 Wed May 11 13:38:37 2011
@@ -1,4 +1,4 @@
-# canonicalize.m4 serial 17
+# canonicalize.m4 serial 18
dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
@@ -64,6 +64,7 @@
touch conftest.a
AC_RUN_IFELSE([
AC_LANG_PROGRAM([[
+ ]GL_NOCRASH[
#include <stdlib.h>
]], [[
int result = 0;
--- modules/canonicalize.orig Wed May 11 13:38:39 2011
+++ modules/canonicalize Wed May 11 13:31:35 2011
@@ -15,6 +15,7 @@
hash-triple
lstat
memmove
+nocrash
pathmax
sys_stat
xalloc
--- modules/canonicalize-lgpl.orig Wed May 11 13:38:39 2011
+++ modules/canonicalize-lgpl Wed May 11 13:31:35 2011
@@ -9,6 +9,7 @@
Depends-on:
extensions
stdlib
+nocrash
alloca-opt [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test
$REPLACE_CANONICALIZE_FILE_NAME = 1]
errno [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test
$REPLACE_CANONICALIZE_FILE_NAME = 1]
lstat [test $HAVE_CANONICALIZE_FILE_NAME = 0 || test
$REPLACE_CANONICALIZE_FILE_NAME = 1]
--
In memoriam Paul Bloomquist <http://en.wikipedia.org/wiki/Paul_Bloomquist>
- realpath(path,NULL),
Bruno Haible <=