Skip to content

Commit

Permalink
Upgrade diffutils from 3.0 to 3.2 on the vendor branch
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmarino committed Oct 29, 2011
1 parent 44b8743 commit 008e37b
Show file tree
Hide file tree
Showing 146 changed files with 3,405 additions and 1,824 deletions.
31 changes: 14 additions & 17 deletions contrib/diffutils/README
Expand Up @@ -8,10 +8,10 @@ Please see the file COPYING for copying conditions.

Please see the file doc/version.texi for version information.

Please see the file doc/diff.texi (or doc/diff.info) for documentation
that can be printed with TeX, or read with the `info' program or with
Emacs's `M-x info'. Brief man pages are in man/*, but they are no
substitute for the documentation.
Please see the file doc/diffutils.texi (or doc/diffutils.info) for
documentation that can be printed with TeX, or read with the `info'
program or with Emacs's `M-x info'. Brief man pages are in man/*,
but they are no substitute for the documentation.

Please see the file ABOUT-NLS for notes about translations.

Expand Down Expand Up @@ -44,24 +44,21 @@ this distribution:
* help2man 1.33 <ftp://ftp.gnu.org/gnu/help2man/help2man-1.33.1.tar.gz>
* Texinfo 4.7 <ftp://ftp.gnu.org/gnu/texinfo/texinfo-4.7.tar.gz>

For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.

Please report bugs to <bug-gnu-utils@gnu.org>.

-----

Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2010 Free Software Foundation,
Copyright (C) 1992, 1998, 2001-2002, 2004, 2009-2011 Free Software Foundation,
Inc.

This file is part of GNU Diffutils.

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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts. A copy of the license is included in the ``GNU Free
Documentation License'' file as part of this distribution.
823 changes: 413 additions & 410 deletions contrib/diffutils/doc/diff.info → contrib/diffutils/doc/diffutils.info

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions contrib/diffutils/lib/anytostr.c
@@ -0,0 +1,55 @@
/* anytostr.c -- convert integers to printable strings
Copyright (C) 2001, 2006, 2008-2011 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
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */

/* Written by Paul Eggert */

/* Tell gcc not to warn about the (i < 0) test, below. */
#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
# pragma GCC diagnostic ignored "-Wtype-limits"
#endif

#include <config.h>

#include "inttostr.h"

/* Convert I to a printable string in BUF, which must be at least
INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the
printable string, which need not start at BUF. */

char * __attribute_warn_unused_result__
anytostr (inttype i, char *buf)
{
char *p = buf + INT_STRLEN_BOUND (inttype);
*p = 0;

if (i < 0)
{
do
*--p = '0' - i % 10;
while ((i /= 10) != 0);

*--p = '-';
}
else
{
do
*--p = '0' + i % 10;
while ((i /= 10) != 0);
}

return p;
}
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/basename-lgpl.c
@@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2010 Free Software
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/basename.c
@@ -1,6 +1,6 @@
/* basename.c -- return the last element in a file name
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2010 Free Software
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/bitrotate.h
@@ -1,5 +1,5 @@
/* bitrotate.h - Rotate bits in integers
Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2008-2011 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-ctype.c
Expand Up @@ -2,7 +2,7 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Character handling in C locale.
Copyright 2000-2003, 2006, 2009-2010 Free Software Foundation, Inc.
Copyright 2000-2003, 2006, 2009-2011 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-ctype.h
Expand Up @@ -7,7 +7,7 @@
<ctype.h> functions' behaviour depends on the current locale set via
setlocale.
Copyright (C) 2000-2003, 2006, 2008-2010 Free Software Foundation, Inc.
Copyright (C) 2000-2003, 2006, 2008-2011 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
Expand Down
58 changes: 23 additions & 35 deletions contrib/diffutils/lib/c-stack.c
@@ -1,7 +1,6 @@
/* Stack overflow handling.
Copyright (C) 2002, 2004, 2006, 2008, 2009, 2010 Free Software Foundation,
Inc.
Copyright (C) 2002, 2004, 2006, 2008-2011 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
Expand Down Expand Up @@ -53,6 +52,12 @@ typedef struct sigaltstack stack_t;
#endif
#ifndef SIGSTKSZ
# define SIGSTKSZ 16384
#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
more than the Linux default of an 8k alternate stack when deciding
if a fault was caused by stack overflow. */
# undef SIGSTKSZ
# define SIGSTKSZ 16384
#endif

#include <stdlib.h>
Expand All @@ -75,9 +80,9 @@ typedef struct sigaltstack stack_t;
#include "ignore-value.h"

#if defined SA_ONSTACK && defined SA_SIGINFO
# define SIGACTION_WORKS 1
# define SIGINFO_WORKS 1
#else
# define SIGACTION_WORKS 0
# define SIGINFO_WORKS 0
# ifndef SA_ONSTACK
# define SA_ONSTACK 0
# endif
Expand All @@ -99,11 +104,16 @@ static char const * volatile stack_overflow_message;
appears to have been a stack overflow, or with a core dump
otherwise. This function is async-signal-safe. */

static void die (int) __attribute__ ((noreturn));
static void
static _Noreturn void
die (int signo)
{
char const *message;
#if !SIGINFO_WORKS && !HAVE_LIBSIGSEGV
/* We can't easily determine whether it is a stack overflow; so
assume that the rest of our program is perfect (!) and that
this segmentation violation is a stack overflow. */
signo = 0;
#endif /* !SIGINFO_WORKS && !HAVE_LIBSIGSEGV */
segv_action (signo);
message = signo ? program_error_message : stack_overflow_message;
ignore_value (write (STDERR_FILENO, program_name, strlen (program_name)));
Expand Down Expand Up @@ -171,9 +181,7 @@ static int segv_handler (void *address __attribute__ ((unused)),
/* Handle a segmentation violation that is likely to be a stack
overflow and exit. This function is async-signal-safe. */

static void overflow_handler (int, stackoverflow_context_t)
__attribute__ ((noreturn));
static void
static _Noreturn void
overflow_handler (int emergency,
stackoverflow_context_t context __attribute__ ((unused)))
{
Expand Down Expand Up @@ -212,29 +220,12 @@ c_stack_action (void (*action) (int))

#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING

/* Direction of the C runtime stack. This function is
async-signal-safe. */

# if STACK_DIRECTION
# define find_stack_direction(ptr) STACK_DIRECTION
# else
# if ! SIGACTION_WORKS || HAVE_XSI_STACK_OVERFLOW_HEURISTIC
static int
find_stack_direction (char const *addr)
{
char dummy;
return ! addr ? find_stack_direction (&dummy) : addr < &dummy ? 1 : -1;
}
# endif
# endif

# if SIGACTION_WORKS
# if SIGINFO_WORKS

/* Handle a segmentation violation and exit. This function is
async-signal-safe. */

static void segv_handler (int, siginfo_t *, void *) __attribute__((noreturn));
static void
static _Noreturn void
segv_handler (int signo, siginfo_t *info,
void *context __attribute__ ((unused)))
{
Expand All @@ -255,17 +246,14 @@ segv_handler (int signo, siginfo_t *info,
if (0 < info->si_code)
{
/* If the faulting address is within the stack, or within one
page of the stack end, assume that it is a stack
overflow. */
page of the stack, assume that it is a stack overflow. */
ucontext_t const *user_context = context;
char const *stack_base = user_context->uc_stack.ss_sp;
size_t stack_size = user_context->uc_stack.ss_size;
char const *faulting_address = info->si_addr;
size_t s = faulting_address - stack_base;
size_t page_size = sysconf (_SC_PAGESIZE);
if (find_stack_direction (NULL) < 0)
s += page_size;
if (s < stack_size + page_size)
size_t s = faulting_address - stack_base + page_size;
if (s < stack_size + 2 * page_size)
signo = 0;

# if DEBUG
Expand Down Expand Up @@ -311,7 +299,7 @@ c_stack_action (void (*action) (int))

sigemptyset (&act.sa_mask);

# if SIGACTION_WORKS
# if SIGINFO_WORKS
/* POSIX 1003.1-2001 says SA_RESETHAND implies SA_NODEFER, but
this is not true on Solaris 8 at least. It doesn't hurt to use
SA_NODEFER here, so leave it in. */
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-stack.h
@@ -1,6 +1,6 @@
/* Stack overflow handling.
Copyright (C) 2002, 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2002, 2004, 2008-2011 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-strcase.h
@@ -1,7 +1,7 @@
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* Case-insensitive string comparison functions in C locale.
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2010 Free Software
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2011 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-strcasecmp.c
@@ -1,7 +1,7 @@
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* c-strcasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2010 Free Software Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2011 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/c-strncasecmp.c
@@ -1,7 +1,7 @@
/* -*- buffer-read-only: t -*- vi: set ro: */
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
/* c-strncasecmp.c -- case insensitive string comparator in C locale
Copyright (C) 1998-1999, 2005-2006, 2009-2010 Free Software Foundation, Inc.
Copyright (C) 1998-1999, 2005-2006, 2009-2011 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
Expand Down
18 changes: 2 additions & 16 deletions contrib/diffutils/lib/cmpbuf.c
@@ -1,6 +1,6 @@
/* Buffer primitives for comparison operations.
Copyright (C) 1993, 1995, 1998, 2001-2002, 2006, 2009-2010 Free Software
Copyright (C) 1993, 1995, 1998, 2001-2002, 2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand All @@ -20,28 +20,14 @@

#include <errno.h>
#include <limits.h>

#include <signal.h>
#ifndef SA_RESTART
# ifdef SA_INTERRUPT /* e.g. SunOS 4.1.x */
# define SA_RESTART SA_INTERRUPT
# else
# define SA_RESTART 0
# endif
#endif

#include <unistd.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#include "cmpbuf.h"
#include "intprops.h"

#ifndef PTRDIFF_MAX
# define PTRDIFF_MAX TYPE_MAXIMUM (ptrdiff_t)
#endif
#ifndef SIZE_MAX
# define SIZE_MAX TYPE_MAXIMUM (size_t)
#endif
#ifndef SSIZE_MAX
# define SSIZE_MAX TYPE_MAXIMUM (ssize_t)
#endif
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/cmpbuf.h
@@ -1,6 +1,6 @@
/* Buffer primitives for comparison operations.
Copyright (C) 2002, 2009-2010 Free Software Foundation, Inc.
Copyright (C) 2002, 2009-2011 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
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/diffseq.h
@@ -1,6 +1,6 @@
/* Analyze differences between two vectors.
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2010 Free Software
Copyright (C) 1988-1989, 1992-1995, 2001-2004, 2006-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/dirname-lgpl.c
@@ -1,6 +1,6 @@
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2010 Free Software
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand Down
2 changes: 1 addition & 1 deletion contrib/diffutils/lib/dirname.c
@@ -1,6 +1,6 @@
/* dirname.c -- return all but the last element in a file name
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2010 Free Software
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2011 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
Expand Down

0 comments on commit 008e37b

Please sign in to comment.