Jim Meyering [Sat, 3 Feb 2007 00:23:57 +0000 (00:23 +0000)]
Make pwd and readlink work also when run with an unreadable parent dir
on systems with openat support.
* lib/getcwd.c (__getcwd) [HAVE_PARTLY_WORKING_GETCWD]: Use the system
provided getcwd function, even when we have openat support.
Reported by Dmitry V. Levin in <http://bugzilla.redhat.com/227168>.
Paul Eggert [Fri, 2 Feb 2007 22:15:43 +0000 (22:15 +0000)]
Avoid mempcpy in the regex code, as the string.h mempcpy stuff
is causing more trouble than it's curing.
* lib/regex_internal.h (__mempcpy): Remove.
* lib/regcomp.c (regerror): Rewrite to avoid the need for mempcpy
(and make the code a tad smaller to boot).
* m4/regex.m4 (gl_PREREQ_REGEX): Don't check for mempcpy.
Paul Eggert [Thu, 1 Feb 2007 08:57:49 +0000 (08:57 +0000)]
* lib/string_.h: If the gnulib module XYZ is not present, undefine
the symbol XYZ before redefining it. This fixes a problem with
programs that don't use XYZ, when compiled on systems that define
XYZ to something else.
Paul Eggert [Thu, 1 Feb 2007 07:56:15 +0000 (07:56 +0000)]
* lib/mkdir-p.c (make_dir_parents): Close a race condition that
occurs when "mkdir -m foo" creates a setgid directory that is (1)
writeable to group or other and (2) is intended to have a special
mode bit that is set or cleared. In such a case, the directory
should be neither group- nor other-writeable until the special
mode bits are right.
Paul Eggert [Mon, 29 Jan 2007 23:12:55 +0000 (23:12 +0000)]
* lib/strptime.h (strptime): Use 'restrict' for args where
POSIX requires this.
* lib/strptime.c (strptime): Likewise.
Change license notice from LGPL to GPL, since gnulib-tool will
change this as needed.
Include <config.h> if _LIBC is not defined, not if HAVE_CONFIG_H is
defined.
Include "strptime.h" first, to check interface.
Do not #undef _LIBC and _NL_CURRENT.
Do not include <stdlib.h>; no longer needed.
Include "time_r.h" and declare ptime_locale_status
only if _LIBC is not defined.
(__P): Remove unused macro.
(match_string): Bring back glibc version, but use it only if _LIBC
is defined.
(__strptime_internal): Compile tm_gmtoff code if _LIBC is defined, too.
Remove unnecessary assertion and abort() call.
Use #ifdef _NL_CURRENT rather than #if 0, for benefit of glibc.
* m4/strptime.m4: Fix serial number comment.
(gl_FUNC_STRPTIME): Require AC_C_RESTRICT, gl_TM_GMTOFF.
* modules/strptime (Files): Add m4/tm_gmtoff.m4.
(Depends-on): Add time_r.
Bruno Haible [Mon, 29 Jan 2007 17:21:16 +0000 (17:21 +0000)]
2007-01-29 Yoann Vandoorselaere <yoann@prelude-ids.org>
* modules/strptime: New file.
* lib/strptime.h: New file.
* lib/strptime.c: New file.
* m4/strptime.m4: New file.
Paul Eggert [Mon, 29 Jan 2007 00:37:14 +0000 (00:37 +0000)]
* lib/regex.h (_Restrict_): Renamed from __restrict, to avoid
a circularity problem with HP-UX ia64 reported by Bob Proulx in
<http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00394.html>.
All uses changed.
(_Restrict_arr_): Renamed from __restrict_arr, for similar reasons.
All uses changed.
* lib/regcomp.c, lib/regexec.c: Change all uses from __restrict
to _Restrict_.
* lib/regexec.c (regexec): Declare pmatch with _Restrict_arr_, so that
the parameter matches the prototype.
Jim Meyering [Sun, 28 Jan 2007 20:14:37 +0000 (20:14 +0000)]
* modules/sys_time (Makefile.am) [MOSTLYCLEANFILES]: Do use
sys/time.h here, reverting that part of the previous patch:
<http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/8959>.
remove it conditionally, too. [added by Jim Meyering]
Jim Meyering [Sun, 28 Jan 2007 18:55:01 +0000 (18:55 +0000)]
* modules/sys_time (Makefile.am): Build sys/time.h only when it's the
value of $(SYS_TIME_H).
[MOSTLYCLEANFILES]: Now that sys/time.h is created only when needed,
remove it conditionally, too.
* m4/sys_time_h.m4 (gl_HEADER_SYS_TIME_H_BODY): Set SYS_TIME_H.
* m4/gettimeofday.m4 (gl_FUNC_GETTIMEOFDAY):
(gl_FUNC_GETTIMEOFDAY_CLOBBER): Set SYS_TIME_H when setting
GETTIMEOFDAY_REPLACEMENT to 1.