Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | prelude: Split bfs-specific utilities into new bfs.h header | Tavian Barnes | 2024-08-28 | 1 | -0/+3 |
| | |||||
* | prelude: Rely more on __has_include() | Tavian Barnes | 2024-08-28 | 1 | -3/+3 |
| | | | | | Rather than a bunch of manual fallback macros, just provide a fallback definition that returns false. | ||||
* | prelude: Define __SANITIZE_*__ | Tavian Barnes | 2024-08-28 | 1 | -3/+3 |
| | |||||
* | Update opengroup.org links to POSIX 2024 | Tavian Barnes | 2024-08-02 | 1 | -2/+2 |
| | |||||
* | bfstd: New xstrtoll() wrapper | Tavian Barnes | 2024-06-04 | 1 | -0/+29 |
| | |||||
* | Make ELOOP an error again, except for -xtype.3.3.1 | Tavian Barnes | 2024-06-03 | 1 | -1/+1 |
| | | | | | | | | | | POSIX requires an error if (for example) -L encounters a symlink loop. The GNU find change was restricted to -xtype, so add a manual ELOOP test to eval_xtype() for compatibility. This reverts commit 470589cbd9ca3e73d8c01ac3a96cbc065179dcc5. Link: https://savannah.gnu.org/bugs/?19605 | ||||
* | bfstd: Treat ELOOP like ENOENT | Tavian Barnes | 2024-05-27 | 1 | -1/+1 |
| | | | | | | | GNU findutils just made the same change, so looping symlinks will be considered broken rather than a hard error. Link: https://savannah.gnu.org/bugs/?51926 | ||||
* | bfstd: New helper for open(ctermid()) | Tavian Barnes | 2024-05-25 | 1 | -0/+10 |
| | |||||
* | Stop using %m | Tavian Barnes | 2024-05-20 | 1 | -0/+4 |
| | |||||
* | Work around https://github.com/llvm/llvm-project/issues/88163 | Tavian Barnes | 2024-05-16 | 1 | -0/+15 |
| | |||||
* | build: Add checks for strtofflags() and string_to_flags() | Tavian Barnes | 2024-05-07 | 1 | -7/+9 |
| | |||||
* | printf: Refactor %y/%Y implementation | Tavian Barnes | 2024-04-24 | 1 | -34/+34 |
| | |||||
* | config: Check for strerror_[lr]() | Tavian Barnes | 2024-04-19 | 1 | -22/+20 |
| | |||||
* | config: Check for pipe2() | Tavian Barnes | 2024-04-19 | 1 | -1/+1 |
| | |||||
* | config: Check for confstr() | Tavian Barnes | 2024-04-19 | 1 | -5/+5 |
| | |||||
* | config: Check for program_invocation_short_name | Tavian Barnes | 2024-04-19 | 1 | -3/+3 |
| | | | | | | This lets us pick it up on musl too, since there's no __MUSL__ macro. Link: https://wiki.musl-libc.org/faq#Q:-Why-is-there-no-%3Ccode%3E__MUSL__%3C/code%3E-macro? | ||||
* | Rename config.h to prelude.h | Tavian Barnes | 2024-04-19 | 1 | -1/+1 |
| | |||||
* | bfstd: Escape ASCII tildes | Tavian Barnes | 2024-03-26 | 1 | -1/+1 |
| | | | | | | | | The POSIX spec [1] lists some characters that may need to be escaped. Unfortunately, the document uses ˜ (U+02DC SMALL TILDE) instead of ~ (U+007E TILDE), and I copy-pasted from it. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02 | ||||
* | bfstd: Add an ASCII fast path to xstrwidth() | Tavian Barnes | 2024-03-21 | 1 | -1/+10 |
| | |||||
* | bfstd: New asciilen() function | Tavian Barnes | 2024-03-21 | 1 | -25/+43 |
| | |||||
* | bfstd: Check that wcwidth() is positive | Tavian Barnes | 2024-03-20 | 1 | -2/+6 |
| | | | | | wcwidth() returns -1 for non-printable characters, but terminals typically don't print anything for them, so treat them as 0. | ||||
* | Re-run include-what-you-use | Tavian Barnes | 2024-03-11 | 1 | -3/+3 |
| | |||||
* | stat: Use errno_is_like(ENOSYS) for EPERM kludge | Tavian Barnes | 2024-02-28 | 1 | -0/+4 |
| | |||||
* | bfstd: Don't shadow FreeBSD's fflags_t | Tavian Barnes | 2024-02-01 | 1 | -4/+4 |
| | |||||
* | ioq: Use the negative errno convention | Tavian Barnes | 2024-01-13 | 1 | -0/+9 |
| | |||||
* | bfstd: New {error,errno}_is_like() functions | Tavian Barnes | 2024-01-13 | 1 | -2/+21 |
| | | | | | | | We used to have is_nonexistence_error() to consistently treat ENOENT and ENOTDIR the same. Recently, we started considering EFAULT the same as ENAMETOOLONG on DragonFly BSD to work around a kernel bug. Unify both of these behind a more generic interface. | ||||
* | bfstd: Fix fflags type on OpenBSD | Tavian Barnes | 2024-01-02 | 1 | -2/+8 |
| | |||||
* | bfstd: New xwcwidth() wrapper | Tavian Barnes | 2023-12-16 | 1 | -1/+1 |
| | |||||
* | bfstd: Wrap is[w]{alpha,digit,...}() | Tavian Barnes | 2023-12-09 | 1 | -31/+12 |
| | |||||
* | bfstd: Work around more instances of llvm/llvm-project#65532 | Tavian Barnes | 2023-11-23 | 1 | -14/+19 |
| | |||||
* | Initial support for Cosmopolitan Libc | Tavian Barnes | 2023-11-10 | 1 | -1/+1 |
| | |||||
* | bfstd: Expose rlim_cmp() | Tavian Barnes | 2023-11-06 | 1 | -0/+33 |
| | |||||
* | bfstd: New xwaitpid() wrapper | Tavian Barnes | 2023-10-31 | 1 | -0/+9 |
| | |||||
* | Use {0} to initialize mbstate_t rather than memset() | Tavian Barnes | 2023-10-27 | 1 | -10/+5 |
| | |||||
* | bfstd: Expose xmbrtowc() and use it in eval_status() | Tavian Barnes | 2023-10-27 | 1 | -13/+13 |
| | |||||
* | bfstd: Only free the locale if we dup'd it successfully | Tavian Barnes | 2023-10-26 | 1 | -3/+3 |
| | |||||
* | wordesc: Don't allow braces in bare words | Tavian Barnes | 2023-10-18 | 1 | -1/+1 |
| | | | | Things like {a,b} should be quoted to avoid brace expansion. | ||||
* | bfstd: Actually use the copied locale | Tavian Barnes | 2023-10-12 | 1 | -1/+1 |
| | | | | This fixes a segfault in xstrerror() when using musl. | ||||
* | bfstd: Add a thread-safe wrapper for strerror() | Tavian Barnes | 2023-10-05 | 1 | -0/+43 |
| | |||||
* | thread: s/call_once/invoke_once/ | Tavian Barnes | 2023-10-03 | 1 | -1/+1 |
| | | | | call_once() is a reserved identifier from C11. | ||||
* | bfstd: Work around a FreeBSD-specific msan issue | Tavian Barnes | 2023-09-06 | 1 | -4/+23 |
| | | | | Link: https://github.com/llvm/llvm-project/issues/65532 | ||||
* | bfstd: Skip a whole loop in dollar_quote() if possible | Tavian Barnes | 2023-09-06 | 1 | -2/+1 |
| | |||||
* | bfstd: Fix printable_len() off-by-one | Tavian Barnes | 2023-09-06 | 1 | -2/+2 |
| | | | | | | | If xmbrtowc() fails, or if xiswprint() is false, then we shouldn't include that wide char in the printable length. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5 | ||||
* | bfstd: Fix an OOB string index in xmbrtowc() | Tavian Barnes | 2023-09-06 | 1 | -6/+2 |
| | | | | | | | | | | | | | | | | | | | | | | This bug could be reproduced with something like $ bfs -samefile $'\xFA\xFA' bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated or worse, with -DNDEBUG, $ bfs -samefile $'.....................\xFA\xFA' bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72 bfs: error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bfs: error: No such file or directory. which prints the memory after the end of the string (in this case, the environment variable USER=tavianator). The bug was caused by the line `*i += len`, which was intended to be `*i = len`. But actually, the right behaviour seems to be `*i += 1`. Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5 | ||||
* | bfstd: Don't label a declaration | Tavian Barnes | 2023-08-08 | 1 | -1/+1 |
| | |||||
* | bfstd: Check multiple chars at once for isascii() | Tavian Barnes | 2023-08-07 | 1 | -3/+20 |
| | |||||
* | bfstd: Speed up wordesc() by caching isprint()/isspace() | Tavian Barnes | 2023-08-07 | 1 | -2/+29 |
| | |||||
* | bfstd: Add an ASCII fast path to wordesc() | Tavian Barnes | 2023-07-13 | 1 | -59/+100 |
| | |||||
* | bfstd: Support wordesc() without allocating | Tavian Barnes | 2023-07-13 | 1 | -38/+54 |
| | |||||
* | bfstd: Quote the whole string the same way in wordesc() | Tavian Barnes | 2023-07-13 | 1 | -77/+101 |
| |