| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The comments explaining how the behavior of 'getopt' varies depending
on whether it's the standalone version and whether there are special
characters at the beginning of the options string were inconsistent
between gnulib and glibc, and also out of sync with the code.
* lib/getopt.c, lib/getopt_int.h: Harmonize comments with glibc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
getopt includes code to parse an environment variable named
_XXX_GNU_nonoption_argv_flags_ (where XXX is the current process's PID
in decimal); but all of it has been #ifdefed out since 2001, with no
official way to turn it back on.
According to commentary in glibc's config.h.in, bash version 2.0
set this environment variable to indicate argv elements that were
the result of glob expansion and therefore should not be treated
as options, but the feature was "disabled later" because "it
caused problems". According to bash's CHANGES file, "later" was
release 2.01; it gives no more detail about what the problems
were.
Version 2.0 of bash was released on the last day of 1996, and version
2.01 in June of 1997. Twenty years later, I think it is safe to
assume that this environment variable isn't coming back.
* lib/getopt_int.h: Remove all #ifdef USE_NONOPTION_FLAGS blocks.
* lib/getopt.c: Likewise. Also remove SWAP_FLAGS and the
__libc_argc and __libc_argv externs, which were only used by
|
|
|
|
|
|
|
|
|
|
| |
glibc sticks to the GNU default of indenting with a mix of
8-column tabs and spaces; make the gnulib copy match.
getopt.h is not included because it is *not* going to be merged in its
present form.
* getopt.c, getopt1.c, getopt_int.h: Tabify.
|
|
|
|
|
|
| |
* lib/glob.c (glob): Reset malloc_home_dir when assigning a pointer to
static storage to home_dir.
Reported by Coverity via Tim Rühsen.
|
|
|
|
|
| |
* lib/glob.c (glob): Free allocated memory before returning.
Reported by Coverity via Tim Rühsen.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/md5.h (buflen): Add comments regarding range.
* lib/sha1.h (buflen): Likewise.
* lib/sha256.h (buflen): Likewise.
* lib/sha512.h (buflen): Likewise.
* lib/md5.c (md5_process_bytes): Add comment why memmove is not needed.
* lib/sha1.c (sha1_process_bytes): Likewise.
* lib/sha256.c (sha256_process_bytes): Likewise.
* lib/sha512.c (sha512_process_bytes): Likewise.
Reported by Coverity via Tim Rühsen.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This does not change anything substantial; it merely simplifies
hypothetical merges back to glibc.
* lib/getopt.c, lib/getopt.in.h, lib/getopt1.c, lib/getopt_int.h:
Change copyright notice to match what is in glibc.
* lib/getopt.c: Reorder includes to match glibc. Remove uses of
USE_IN_LIBIO. Remove 'register'. In __LIBC code, use
__open_memstream rather than open_memstream and __glibc_likely
instead of __builtin_expect.
* lib/getopt.in.h (__posix_getopt) [!__GETOPT_PREFIX]: New decl.
|
|
|
|
|
|
|
|
| |
Problem reported by John P. Linderman (Bug#26193).
* lib/dfa.c (parse_bracket_exp): Remove redundant assignment.
If both ends of the range are ASCII digits, do not worry about
multi-character collating sequences and the like. Be consistent
about using isalpha as a precondition for setbit_case_fold_c.
|
|
|
|
|
| |
* lib/glthread/lock.h (pthread_rwlockattr_setkind_np): Don't declare
weak on non-glibc platforms.
|
|
|
|
|
|
|
|
|
|
|
| |
Problems reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00078.html
* lib/stdalign.in.h (_Alignas):
* m4/stdalign.m4 (gl_STDALIGN_H):
Use octal, not decimal, for __HP_cc version. Perhaps HP formerly
used octal (as that is how they document it), but it is decimal in
practice now and the ancient implementations no longer matter.
* tests/test-stdalign.c (main) [__HP_cc && __ia64]: Skip test.
|
|
|
|
|
|
|
|
| |
* lib/vma-iter.c (vma_iterate): On Solaris, use the /proc filesystem
approach.
* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on Solaris.
* lib/get-rusage-as.c: Update comment about Solaris.
* lib/get-rusage-data.c: Likewise.
|
|
|
|
|
|
| |
* lib/vma-iter.c (vma_iterate): Move HP-UX specific implementation up.
* lib/vma-iter.h: Update.
Just in case HP-UX ever implements mquery().
|
|
|
|
|
|
|
|
|
| |
See Bruno Haible's email in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00066.html
which cites p 150 of a manual saying that 'aligned' works on Itanium.
* lib/stdalign.in.h (_Alignas):
Assume the '061200' applies to Itanium, not to PA-RISC.
* m4/stdalign.m4 (gl_STDALIGN_H): Adjust to match stdalign.in.h.
|
|
|
|
|
| |
* lib/stat-time.h: Add "C" linkage declaration.
* lib/timespec.h: Likewise.
|
|
|
|
|
|
| |
* lib/stdalign.in.h (_Alignas): Don't define for HP-UX cc.
* m4/stdalign.m4 (gl_STDALIGN_H): No need to enable the extra test
for HP-UX cc.
|
|
|
|
|
|
|
| |
* lib/stdint.in.h (_STDINT_MIN): Remove macro.
(_STDINT_UNSIGNED_MIN, _STDINT_SIGNED_MIN): New macros.
(PTRDIFF_MIN, SIG_ATOMIC_MIN, WCHAR_MIN, WINT_MIN): Define using
_STDINT_UNSIGNED_MIN, _STDINT_SIGNED_MIN.
|
|
|
|
|
|
|
|
|
| |
* modules/vma-iter (configure.ac): Check for 'pstat_getprocvm'.
* lib/vma-iter.c (vma_iterate): On HP-UX, use pstat_getprocvm().
* lib/vma-iter.h (VMA_ITERATE_SUPPORTED): Define also on HP-UX.
* lib/get-rusage-as.c: Update comment about HP-UX.
* lib/get-rusage-data.c: Likewise.
(get_rusage_data): Use get_rusage_data_via_setrlimit.
|
|
|
|
|
| |
* lib/limits.in.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Define if not
defined.
|
|
|
|
| |
* lib/freadahead.c (__sreadahead): Declare ourselves.
|
|
|
|
|
| |
* lib/vma-iter.c: Add comment about why this module is not implemented
on AIX.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem reported by Michal Privoznik in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-03/msg00039.html
* lib/_Noreturn.h: Rename from build-aux/snippet/_Noreturn.h.
* lib/arg-nonnull.h: Rename from build-aux/snippet/arg-nonnull.h.
* lib/c++defs.h: Rename from build-aux/snippet/c++defs.h.
* lib/unused-parameter.h: Rename from
build-aux/snippet/unused-parameter.h.
* lib/warn-on-use.h: Rename from build-aux/snippet/warn-on-use.h.
* modules/snippet/_Noreturn (Files:, _NORETURN_H):
* modules/snippet/arg-nonnull (Files:, ARG_NONNULL_H):
* modules/snippet/c++defs (Files:, CXXDEFS_H):
* modules/snippet/unused-parameter (Files:, UNUSED_PARAMETER_H):
* modules/snippet/warn-on-use (Files: WARN_ON_USE_H):
Adjust to file renamings.
|
|
|
|
|
| |
* lib/vma-iter.h (vma_iterate): Return 'int', not 'void'.
* lib/vma-iter.c (vma_iterate): Return -1 in case of error.
|
|
|
|
| |
* lib/dtotimespec.c (dtotimespec): Simplify.
|
|
|
|
|
|
| |
* lib/nproc.c (num_processors_ignoring_omp): New function, extracted
from num_processors.
(num_processors): In this function, only deal with OMP.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adjust to match the return value from omp_get_num_threads(), i.e.:
- honor OMP_THREAD_LIMIT without OMP_NUM_THREADS
- Treat 0 as an invalid value and ignore
Also remove the call to omp_get_num_threads()
added in the previous recent commit, because it's
ineffective without the omp pragmas in place.
* lib/nproc.c (parse_omp_threads): Return 0 if specified,
so that it can be ignored.
(num_processors): Honor OMP_THREAD_LIMIT even without
OMP_NUM_THREADS being set. Also fix a typo in the environment
variable being checked, from the previous recent commit.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib/nproc.c (parse_omp_threads): A new function refactored
from num_processors() to support parsing both of the
above environment variables.
(num_processors): Prefer using omp_get_num_threads() with [_OPENMP]
to accurately reflect the current OpenMP nesting level.
Also support the OMP_THREAD_LIMIT environment variable
to limit the max value determined from OMP_NUM_THREADS.
* modules/nproc: Depend on minmax header.
Suggested by Oliver Heimlich.
|
|
|
|
|
|
| |
Work around -Wdouble-promotion false alarm in recent GCCs.
* lib/ftoastr.c (PROMOTED_FLOAT): New macro.
(ftoastr_snprintf, FTOASTR): Use it.
|
|
|
|
|
|
|
|
|
| |
Reported by Rene Saavedra <rennes@openmailbox.org> in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25821 via Paul Eggert.
* lib/glthread/lock.h: On glibc systems without
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP, use the fallback
implementation of rwlocks.
* lib/glthread/lock.c: Likewise.
|
|
|
|
| |
* lib/xbinary-io.c: Set XBINARY_IO_INLINE, not XSETMODE_INLINE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is taken from suggestions by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00060.html
http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00061.html
* lib/binary-io.c (__gl_setmode_check): Set errno to EINVAL,
not ENOTTY, when it is an inappropriate device.
* lib/binary-io.h (SET_BINARY): Resurrect.
* lib/xbinary-io.c: Rename from lib/xsetmode.c.
(xset_binary_mode_error): Rename from xsetmode_error.
* lib/xbinary-io.h: Rename from lib/xsetmode.h.
(xset_binary_mode): Rename from xsetmode.
All uses changed.
* modules/xbinary-io: Rename from modules/xsetmode.
Update file names.
* tests/test-binary-io.sh (tmpfiles): Remove no-longer-used file name.
* NEWS: Update to match revised behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is to fix a problem noted by Eric Blake.
Code was using xfreopen to change files to binary mode, but this
fails for stdout when in append mode. Such code should use
xsetmode instead.
* NEWS: Document incompatible changes to binary-io module.
* lib/binary-io.c (__gl_setmode_check) [__DJGPP__ || __EMX__]:
New function.
* lib/binary-io.h (__gl_setmode): Rename from set_binary_mode.
(set_binary_mode): New function, which also checks for tty.
* lib/xsetmode.c, lib/xsetmode.h, modules/xsetmode: New files.
|
|
|
|
|
| |
* lib/mbfile.h, lib/se-selinux.in.h: Fix typos by replacing
_GL_INLINE_HEADER_BEGIN with _GL_INLINE_HEADER_END.
|
|
|
|
|
| |
* lib/se-selinux.in.h: Don't assume that include_next skips over
duplicate -I DIR options.
|
|
|
|
| |
* lib/argp-pin.c (dummy): Declare as needed to make file nonempty.
|
|
|
|
|
|
|
| |
* lib/unicase/special-casing.h (gl_unicase_special_lookup): Gperf 3.1
uses 'size_t' as the datatype for the 'len' parameter in the functions
it generates. Update the prototype specified here to match the newly
generated function.
|
|
|
|
|
|
| |
Problem reported by Bruno Haible in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-02/msg00031.html
* lib/glob.c (glob): Don't assume HAVE_GETPWNAM_R || _LIBC.
|
|
|
|
|
|
| |
* m4/search_h.m4 (gl_SEARCH_H): Determine HAVE_TYPE_VISIT.
* modules/search (Makefile.am): Substitute HAVE_TYPE_VISIT.
* lib/search.in.h (VISIT): Define if HAVE_TYPE_VISIT is 0.
|
|
|
|
|
|
|
| |
* lib/glthread/lock.h [USE_POSIX_THREADS_WEAK]: Declare also
pthread_rwlockattr_init, pthread_rwlockattr_setkind_np,
pthread_rwlockattr_destroy weak.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch fixes one real bug in gl_anylinked_list2.h, along with
some minor glitches that are not bugs. It does not silence PGI’s
thousands of bogus warnings when compiling test-intprops.c.
Fortunately, the warnings do not cause a failure.
* lib/c-ctype.h (_C_CTYPE_LOWER_A_THRU_F_N, _C_CTYPE_LOWER_N):
Rename parameter to avoid PGI warning about ‘#define f(n) 'n'’.
My goodness, PGI goes back a long ways - this predates C89!
* lib/gl_anylinked_list2.h (ASYNCSAFE): Fix bug caught by PGI.
For example, ASYNCSAFE (const void *) should expand to
‘const void *volatile’, not to ‘volatile const void *’.
* lib/spawn.in.h (POSIX_SPAWN_USEVFORK): Don't define if already defined.
* lib/verify.h (verify) [!__GNUC__]:
Use shorter albeit meaningless string to bypass silly compiler limits.
* tests/infinity.h (Infinityf, Infinityd, Infinityl) [__PGI]:
* tests/nan.h (NaNf, NaNd, NaNl):
Use static functions to avoid misguided compiler diagnostics.
Is there some reason we don’t use static functions on all platforms?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This API change was prompted by a report by Pádraig Brady in:
https://bug.debian.org/851934#10
To help fix the bug, make parse_datetime2 more reentrant.
* NEWS: Document this incompatible change.
* lib/parse-datetime.h, lib/parse-datetime.y (parse_datetime2):
Add two arguments, the timezone and the timezone name.
All callers changed. If TZ="..." is specified, use it for
calculating defaults.
* lib/parse-datetime.y: Don't include xalloc.h or use xmalloc, as
this code should be usable in a library.
(mktime_ok, get_effective_timezone):
Accept timezone arg too. All callers changed.
(get_tz): Remove.
(get_effective_timezone): Check for failures.
* modules/parse-datetime: Add time_r, time_rz. Remove xalloc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cygwin 2.6 introduced uselocale() and thread-local locales in general,
but lacks any way to get at the name of each portion of a locale_t
object short of peeking behind an opaque object. Cygwin has just
been patched to add NL_LOCALE_NAME() patterned after glibc's
extension of the same name[1], but as that version of Cygwin has not
yet been released, we might as well work around it in the meantime.
[1] https://sourceware.org/ml/newlib/2017/msg00071.html
* lib/localename.c (gl_locale_name_thread_unsafe): Add clause for
Cygwin.
* modules/localename (Depends-on): Add extensions, since
NL_LOCALE_NAME() is not visible without it.
Signed-off-by: Eric Blake <eblake@redhat.com>
|
|
|
|
|
|
|
| |
Problem reported by Arnold Robbins in:
http://lists.gnu.org/archive/html/bug-grep/2017-01/msg00006.html
* lib/dfa.c (epsclosure): Do it.
|
|
|
|
|
|
|
| |
* NEWS: Document this.
* lib/localeinfo.c (case_folded_counterparts):
First arg is now wint_t, not wchar_t. This generalizes the
function to also work on WEOF, where it returns 0.
|
|
|
|
|
| |
* lib/dfa.c (copy): Don’t pass NULL with size 0 to memcpy,
as this runs afoul of gcc -fsanitize=undefined.
|
|
|
|
|
|
|
|
|
| |
* lib/strftime.c (DO_TZ_OFFSET): Omit arg 'negative'; it's now
the caller's responsibility to set 'negative_number'. All uses changed.
(__strftime_internal): Put '-' before a zero UTC offset if the time
zone abbreviation starts with "-", which is the recently-introduced
tzdb convention for an unknown UTC offset that is arbitrarily set to 0.
* tests/test-strftime.c: Test for this.
|
|
|
|
| |
* lib/dfa.c (build_state): Simplify by using emptyset.
|
|
|
|
|
|
|
|
|
|
| |
* lib/dfa.c (newline_constraint, letter_constraint)
(other_constraint, prev_newline_dependent)
(prev_letter_dependent, NO_CONSTRAINT, BEGLINE_CONSTRAINT)
(ENDLINE_CONSTRAINT, BEGWORD_CONSTRAINT, ENDWORD_CONSTRAINT)
(LIMWORD_CONSTRAINT, NOTLIMWORD_CONSTRAINT):
Constraints need only 3 bits, not 4. Using smaller integers
shrinks the code a bit and makes grep a tad faster on x86-64.
|
|
|
|
|
| |
* lib/dfa.c (alloc_position_set): Do not worry about ptrdiff_t
overflow, since xnmalloc does that now.
|
|
|
|
|
| |
* lib/dfa.c (dfaanalyze): Do not allocate follow set, since
an all-zero follow set works just fine.
|