24 Commits

Author SHA1 Message Date
Rose
725d3fdc20 Prefer putchar over fputc where possible
putchar is easier to understand than fputc and printf and does less work than those two do.
2024-01-13 15:24:43 -07:00
Rose
e095069d2a Prefer fputs over fprintf where possible
fprintf does extra work and meant for formatting strings.
2023-10-15 10:28:57 -06:00
Todd C. Miller
e343e07543 Use #include <foo.h> instead of #include "foo.h" in most cases.
We rely on the include path to find many of these headers.  It
especially doesn't make sense to use #include "foo.h" for headers
in the top-level include directory.
2023-09-25 10:13:28 -06:00
Todd C. Miller
03ad96e445 Use the fallthrough attribute instead of /* FALLTHROUGH */ comments. 2020-08-01 13:10:50 -06:00
Todd C. Miller
446ae3f507 Include string.h unconditionally and only use strings.h for strn?casecmp()
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
dd88460800 We no longer need to include headers we don't use for sudo*.h files.
Previously we needed to include headers required by the various
sudo*h files.  Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
2020-05-18 06:47:04 -06:00
Todd C. Miller
99129ba41f Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX. 2020-04-21 11:05:29 -06:00
Todd C. Miller
1e1ef61902 Add SPDX-License-Identifier to files. 2019-04-29 07:21:51 -06:00
Todd C. Miller
48fba3c2cc update my email to Todd.Miller@sudo.ws 2017-12-03 17:53:40 -07:00
Todd C. Miller
6af6f84670 Fix exponential behavior in glob() with respect to multiple '*'.
See https://research.swtch.com/glob
Adapted from https://perl5.git.perl.org/perl.git/commit/33252c318625f3c6c89b816ee88481940e3e6f95
2017-04-28 12:12:00 -06:00
Todd C. Miller
d77941c2be We require POSIX so no need to conditionally include dirent.h.
Add a check for d_namlen and use the result in the NAMLEN macro.
2015-07-02 09:24:48 -06:00
Todd C. Miller
0b241088b3 There's no need to conditionalize the #include <unistd.h>, we require
a POSIX system.
2015-07-02 09:08:28 -06:00
Todd C. Miller
4a07b472f0 Only include stddef.h where it is needed. 2015-06-20 05:34:35 -06:00
Todd C. Miller
dc883f2454 We require ANSI C so stop using the obsolete STDC_HEADERS. 2015-06-19 14:29:27 -06:00
Todd C. Miller
a50555faa2 Remove support for the obsolete malloc.h header. 2015-06-18 20:30:59 -06:00
Todd C. Miller
f43f530987 Move pattern length check until after we have initialized the glob_t
so we can call globfree() even on error.  From Frank Denis.
2015-06-13 08:13:48 -06:00
Todd C. Miller
c75eb5bf0d Use reallocarray where possible. 2015-05-14 10:21:58 -06:00
Todd C. Miller
a9bf105eda Use stdint.h to get SIZE_MAX as inttypes.h on some pre-C99 HP-UX
systems doesn't include stdint.h itself.
2015-02-03 10:00:30 -07:00
Todd C. Miller
fd149e632e Need to include inttypes.h for SIZE_MAX 2015-02-02 14:20:24 -07:00
Todd C. Miller
237f3c9dfe Add support for GLOB_LIMIT from OpenBSD (not currently used) and
also a limit on the max recursion depth for glob().
2014-12-16 17:04:13 -07:00
Todd C. Miller
b633e88c12 Quiet compiler sign compare warning. 2014-12-16 10:46:25 -07:00
Todd C. Miller
47835ff289 Rename missing.h -> sudo_compat.h 2014-07-22 14:25:16 -06:00
Todd C. Miller
87c2fe5a31 Prefix all libc replacements with sudo_ and #define the real name
to the sudo_ version.  That way we don't pollute the libc namespace.
2014-06-26 15:51:08 -06:00
Todd C. Miller
4d37a4a162 Top level directory reorg
Move src/po -> po
Combine common and compat -> lib/util
Move zlib -> lib/zlib
2014-06-26 15:51:02 -06:00