canonicalize-lgpl: fix glibc bug with trailing slash
authorEric Blake <ebb9@byu.net>
Fri, 11 Sep 2009 19:57:55 +0000 (13:57 -0600)
committerEric Blake <ebb9@byu.net>
Fri, 18 Sep 2009 01:16:31 +0000 (19:16 -0600)
commit4e793c35b62f5ea945b7d33ce36c78fc4d645b3a
tree0ebd7b72e3d37df3c03fd7a8752b3fbbd1476fcc
parent1d43c4ae818052a72c616311a99b3d1ca3bf1cfb
canonicalize-lgpl: fix glibc bug with trailing slash

Consolidate the m4 macros into a single file, since both modules
now have to worry about replacing canonicalize_file_name on
buggy glibc.

* m4/canonicalize-lgpl.m4: Move contents...
* m4/canonicalize.m4: ...here.
(gl_CANONICALIZE_LGPL): Factor realpath check...
(gl_FUNC_REALPATH_WORKS): ...into new macro.  Enhance to catch
glibc 2.3.5 bug, fixed 2005-04-27.
(gl_FUNC_CANONICALIZE_FILENAME_MODE): Use it.
(gl_PREREQ_CANONICALIZE_LGPL): Inline...
(gl_CANONICALIZE_LGPL_SEPARATE): ...into this macro.
* modules/canonicalize-lgpl (Files): Manage file rename.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Provide default.
* modules/stdlib (Makefile.am): Substitute witness.
* lib/stdlib.in.h (canonicalize_file_name): Declare if replacement
is needed.
* lib/canonicalize-lgpl.c: Also compile if canonicalize_file_name
replacement is required.
* lib/canonicalize.c (canonicalize_file_name): Likewise.
* doc/glibc-functions/canonicalize_file_name.texi
(canonicalize_file_name): Document this.
* doc/posix-functions/realpath.texi (realpath): Likewise.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
doc/glibc-functions/canonicalize_file_name.texi
doc/posix-functions/realpath.texi
lib/canonicalize-lgpl.c
lib/canonicalize.c
lib/stdlib.in.h
m4/canonicalize-lgpl.m4 [deleted file]
m4/canonicalize.m4
m4/stdlib_h.m4
modules/canonicalize-lgpl
modules/stdlib