Age | Commit message (Collapse) | Author |
|
`#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
have their own, conflicting declaration of strtoimax in sys/inttypes.h.
(strtoumax): Likewise, for completeness (it wasn't necessary).
|
|
|
|
(strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
to work around bug in IBM C compiler.
|
|
|
|
|
|
|
|
fix the HAVE_GETCWD_NULL code to behave more like the
!HAVE_GETCWD_NULL code used to.
Include "xalloc.h".
(xgetcwd): Do not return NULL when memory is exhausted; instead,
invoke xalloc_die.
|
|
|
|
|
|
Use ssize_t, not int, to store result of readlink.
Check for ssize_t overflow as well as size_t overflow,
as POSIX says the result of readlink is implementation-defined
when ssize_t overflows.
Remove unnecessary cast to char*.
Use free+malloc instead of realloc, as the storage doesn't need
to be preserved and it's clearer and can be more efficient that way.
(SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
|
|
|
|
usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was
spotted by Jim Meyering.
|
|
|
|
|
|
|
|
|
|
|
|
like the HAVE_GETCWD_NULL code.
Include pathmax.h if not HAVE_GETCWD.
Do not include xalloc.h.
(INITIAL_BUFFER_SIZE): New symbol.
Do not use xmalloc / xrealloc, since the caller is responsible for
handling errors. Preserve errno around `free' during failure.
Do not overrun buffer when using getwd.
|
|
|
|
to decide whether to use getcwd (NULL, 0).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
doesn't conflict with sparc-sun-solaris2.7's definition in
/usr/include/sys/int_types.h.
|
|
|
|
(fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
and strncasecmp as r-values. Unixware didn't have declarations.
|
|
|
|
|
|
Use an initial, malloc'd, buffer of length 128 rather than
a statically allocated one of length 1024.
|
|
|
|
Include stdlib.h and unistd.h if available.
Include xalloc.h.
(xmalloc, xstrdup, free): Remove decls.
(xgetcwd): Don't assume sizes fit in unsigned.
Check for overflow when computing sizes.
Simplify reallocation code.
|
|
|
|
|
|
Also, make the following further changes to make this file's
configuration more similar to that of strtol.c:
(UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED. All uses changed.
(strtoumax, uintmax_t, strtoull, strtol): Remove.
(intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
(strtoimax): Renamed from strtoumax. All uses of unsigned values
changed to signed values.
And make the following changes as well:
Fix copyright notice, as 1999 was missing.
(verify): New macro.
(strtoimax): Check sizes at compile-time, not run-time.
Prefer strtol to strtoll if both work.
(main): Remove; it was not that useful and was a pain to maintain.
|
|
|
|
|
|
a directory's st_size can have an arbitrary value, so the old
usage could waste an arbitrary amount of memory. All uses
changed.
|
|
|
|
|
|
|
|
|
|
(_DECLARE_XSTRTOL): Improve quality of diagnostic for
LONGINT_INVALID_SUFFIX_CHAR.
|
|
|
|
|
|
|