mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-21 07:33:30 +08:00
Sync from gnulib.
This commit is contained in:
parent
47bcfc54da
commit
5a5367474b
@ -1,3 +1,7 @@
|
||||
2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* texinfo.tex: Sync from gnulib.
|
||||
|
||||
2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* config.guess, install-sh, texinfo.tex: Sync from gnulib.
|
||||
|
@ -3,7 +3,7 @@
|
||||
% Load plain if necessary, i.e., if running under initex.
|
||||
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
|
||||
%
|
||||
\def\texinfoversion{2004-09-06.16}
|
||||
\def\texinfoversion{2004-10-31.06}
|
||||
%
|
||||
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
|
||||
@ -2732,19 +2732,17 @@ where each line of input produces a line of output.}
|
||||
\global\setpercentfalse
|
||||
}
|
||||
|
||||
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
|
||||
% If so, do nothing. If not, give it an appropriate dimension based on
|
||||
% current baselineskip.
|
||||
\def\setmultitablespacing{%
|
||||
\def\multistrut{\strut}% just use the standard line spacing
|
||||
%
|
||||
% Compute \multitablelinespace (if not defined by user) for use in
|
||||
% \multitableparskip calculation. We used define \multistrut based on
|
||||
% this, but (ironically) that caused the spacing to be off.
|
||||
% See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
|
||||
\ifdim\multitablelinespace=0pt
|
||||
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
|
||||
\global\advance\multitablelinespace by-\ht0
|
||||
%% strut to put in table in case some entry doesn't have descenders,
|
||||
%% to keep lines equally spaced
|
||||
\let\multistrut = \strut
|
||||
\else
|
||||
%% FIXME: what is \box0 supposed to be?
|
||||
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
|
||||
width0pt\relax} \fi
|
||||
\fi
|
||||
%% Test to see if parskip is larger than space between lines of
|
||||
%% table. If not, do nothing.
|
||||
%% If so, set to same dimension as multitablelinespace.
|
||||
|
@ -1,3 +1,7 @@
|
||||
2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* getdate.y, getpass.c, setenv.h: Sync from gnulib.
|
||||
|
||||
2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* getdate.y, getpagesize.h, mktime.c: Sync from gnulib.
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -1307,8 +1308,8 @@ get_date (struct timespec *result, char const *p, struct timespec const *now)
|
||||
int month = tm.tm_mon + pc.rel_month;
|
||||
int day = tm.tm_mday + pc.rel_day;
|
||||
if (((year < tm.tm_year) ^ (pc.rel_year < 0))
|
||||
| (month < tm.tm_mon) ^ (pc.rel_month < 0)
|
||||
| (day < tm.tm_mday) ^ (pc.rel_day < 0))
|
||||
| ((month < tm.tm_mon) ^ (pc.rel_month < 0))
|
||||
| ((day < tm.tm_mday) ^ (pc.rel_day < 0)))
|
||||
goto fail;
|
||||
tm.tm_year = year;
|
||||
tm.tm_mon = month;
|
||||
@ -1365,8 +1366,6 @@ get_date (struct timespec *result, char const *p, struct timespec const *now)
|
||||
|
||||
#if TEST
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main (int ac, char **av)
|
||||
{
|
||||
|
@ -58,16 +58,26 @@
|
||||
#elif USE_UNLOCKED_IO
|
||||
# include "unlocked-io.h"
|
||||
#else
|
||||
# undef fflush_unlocked
|
||||
# define fflush_unlocked(x) fflush (x)
|
||||
# undef flockfile
|
||||
# define flockfile(x) ((void) 0)
|
||||
# undef funlockfile
|
||||
# define funlockfile(x) ((void) 0)
|
||||
# undef fputs_unlocked
|
||||
# define fputs_unlocked(str,stream) fputs (str, stream)
|
||||
# undef putc_unlocked
|
||||
# define putc_unlocked(c,stream) putc (c, stream)
|
||||
# if !HAVE_DECL_FFLUSH_UNLOCKED
|
||||
# undef fflush_unlocked
|
||||
# define fflush_unlocked(x) fflush (x)
|
||||
# endif
|
||||
# if !HAVE_DECL_FLOCKFILE
|
||||
# undef flockfile
|
||||
# define flockfile(x) ((void) 0)
|
||||
# endif
|
||||
# if !HAVE_DECL_FUNLOCKFILE
|
||||
# undef funlockfile
|
||||
# define funlockfile(x) ((void) 0)
|
||||
# endif
|
||||
# if !HAVE_DECL_FPUTS_UNLOCKED
|
||||
# undef fputs_unlocked
|
||||
# define fputs_unlocked(str,stream) fputs (str, stream)
|
||||
# endif
|
||||
# if !HAVE_DECL_PUTC_UNLOCKED
|
||||
# undef putc_unlocked
|
||||
# define putc_unlocked(c,stream) putc (c, stream)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if _LIBC
|
||||
|
12
lib/setenv.h
12
lib/setenv.h
@ -1,5 +1,5 @@
|
||||
/* Setting environment variables.
|
||||
Copyright (C) 2001-2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2004 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
|
||||
@ -34,7 +34,15 @@ extern int setenv (const char *name, const char *value, int replace);
|
||||
|
||||
#endif
|
||||
|
||||
#if !HAVE_UNSETENV
|
||||
#if HAVE_UNSETENV
|
||||
|
||||
# if VOID_UNSETENV
|
||||
/* On some systems, unsetenv() returns void.
|
||||
This is the case for FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
|
||||
# define unsetenv(name) ((unsetenv)(name), 0)
|
||||
# endif
|
||||
|
||||
#else
|
||||
|
||||
/* Remove the variable NAME from the environment. */
|
||||
extern int unsetenv (const char *name);
|
||||
|
@ -41,6 +41,8 @@
|
||||
# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
|
||||
#endif
|
||||
|
||||
#define MAXSIZE (SIZE_MAX < SSIZE_MAX ? SIZE_MAX : SSIZE_MAX)
|
||||
|
||||
#include "xalloc.h"
|
||||
|
||||
/* Call readlink to get the symbolic link value of FILENAME.
|
||||
@ -56,14 +58,15 @@ xreadlink (char const *filename, size_t size)
|
||||
{
|
||||
/* The initial buffer size for the link value. A power of 2
|
||||
detects arithmetic overflow earlier, but is not required. */
|
||||
size_t buf_size = size + 1;
|
||||
size_t buf_size = size < MAXSIZE ? size + 1 : MAXSIZE;
|
||||
|
||||
while (1)
|
||||
{
|
||||
char *buffer = xmalloc (buf_size);
|
||||
ssize_t link_length = readlink (filename, buffer, buf_size);
|
||||
ssize_t r = readlink (filename, buffer, buf_size);
|
||||
size_t link_length = r;
|
||||
|
||||
if (link_length < 0)
|
||||
if (r < 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (buffer);
|
||||
@ -71,15 +74,18 @@ xreadlink (char const *filename, size_t size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((size_t) link_length < buf_size)
|
||||
if (link_length < buf_size)
|
||||
{
|
||||
buffer[link_length] = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
free (buffer);
|
||||
buf_size *= 2;
|
||||
if (! (0 < buf_size && buf_size <= SSIZE_MAX))
|
||||
if (buf_size <= MAXSIZE / 2)
|
||||
buf_size *= 2;
|
||||
else if (buf_size < MAXSIZE)
|
||||
buf_size = MAXSIZE;
|
||||
else
|
||||
xalloc_die ();
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2004-11-02 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* getpass.m4: Sync from gnulib.
|
||||
|
||||
2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* getpagesize.m4: Sync from gnulib.
|
||||
|
@ -34,5 +34,6 @@ AC_DEFUN([gl_FUNC_GETPASS_GNU],
|
||||
# Prerequisites of lib/getpass.c.
|
||||
AC_DEFUN([gl_PREREQ_GETPASS], [
|
||||
AC_CHECK_HEADERS_ONCE(stdio_ext.h)
|
||||
AC_CHECK_DECLS_ONCE([fflush_unlocked flockfile fputs_unlocked funlockfile putc_unlocked])
|
||||
:
|
||||
])
|
||||
|
Loading…
Reference in New Issue
Block a user