* Mark Kettenis writes:
> It makes sense to me to use canonicalize_file_name.  However using
> #ifdef _GNU_SOURCE is not the right way to do this.  Use an autoconf
> test for canonicalize filename instead.

Will the following be OK (I didn't bother adding the patch for the regenerated
configure and config.in, the patches become so messy)?

2002-02-22  Alfred M. Szmidt <[EMAIL PROTECTED]>

        * configure.in: (AC_CHECK_FUNCS) Added test for canonicalize_file_name
        Regenerated.
        * config.h.in: Regenerated.
        * utils.c: (gdb_realpath) If HAVE_CANONICALIZE_FILE_NAME is defined
        use canonicalize_file_name.
        
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.80
diff -u -p -r1.80 configure.in
--- configure.in        2002/02/14 05:31:45     1.80
+++ configure.in        2002/02/22 17:19:01
@@ -131,8 +131,8 @@ AC_HEADER_STAT
 
 AC_C_CONST
 
-AC_CHECK_FUNCS(bcopy btowc bzero isascii poll realpath sbrk setpgid setpgrp \
-       sigaction sigprocmask sigsetmask)
+AC_CHECK_FUNCS(bcopy btowc bzero canonicalize_file_name isascii poll
+       realpath sbrk setpgid setpgrp sigaction sigprocmask sigsetmask )
 AC_FUNC_ALLOCA
 AC_FUNC_VFORK
 dnl AC_FUNC_SETPGRP does not work when cross compiling
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.64
diff -u -p -r1.64 utils.c
--- utils.c     2002/02/13 06:06:26     1.64
+++ utils.c     2002/02/22 17:19:02
@@ -2526,7 +2526,9 @@ string_to_core_addr (const char *my_stri
 char *
 gdb_realpath (const char *filename)
 {
-#ifdef HAVE_REALPATH
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+  return canonicalize_file_name (filename);
+#elif HAVE_REALPATH
 #if defined (PATH_MAX)
   char buf[PATH_MAX];
 #elif defined (MAXPATHLEN)


-- 
Alfred M. Szmidt

_______________________________________________
Bug-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-hurd

Reply via email to