summaryrefslogtreecommitdiffstats
path: root/src/parse.c
Commit message (Collapse)AuthorAgeFilesLines
* parse: Add a "logo" to bfs --versionTavian Barnes2024-09-141-1/+32
|
* build: Move feature test macros to prelude.hTavian Barnes2024-08-281-1/+0
| | | | | | This replaces the explicit CPPFLAGS list in flags.mk with just `-include src/prelude.h`, shortening our compiler command lines and allowing them to be easily documented.
* prelude: Split bfs-specific utilities into new bfs.h headerTavian Barnes2024-08-281-0/+3
|
* docs: Document the new -mount vs. -xdev behaviourTavian Barnes2024-08-161-2/+1
| | | | Fixes: 33b85e1 ("Implement POSIX 2024's -mount")
* New -noerror option to suppress error messagesTavian Barnes2024-08-161-0/+11
| | | | Closes: https://github.com/tavianator/bfs/issues/142
* expr: Tell expressions what kind of expression they areTavian Barnes2024-08-151-188/+161
|
* Default to no for "Do you want to continue?" promptsTavian Barnes2024-08-131-1/+1
|
* opt: Warn about ignored expressions after dangerous actionsTavian Barnes2024-08-121-11/+23
| | | | | | For example, `bfs -delete -type f` is almost certainly a mistake. Link: https://savannah.gnu.org/bugs/?65895
* prelude: s/fallthru/_fallthrough/ for consistency with other attributesTavian Barnes2024-08-091-9/+9
|
* parse: Take umask into account in parse_mode()Tavian Barnes2024-08-021-8/+15
| | | | | | | POSIX 2024 clarified that find(1) is meant to work exactly like chmod(1) here, so for modes like +rw,-x with no "who" specified, apply the umask. Link: https://www.austingroupbugs.net/view.php?id=1392
* parse: Fix names in parse_mode()Tavian Barnes2024-08-021-14/+14
| | | | | | | Commit 9c6e4ce ("parse: s/parser_state/bfs_parser/") was a little to overzealous in replacing "state" with "parser", resulting in the tortured phrase "parser machine parser" instead of "state machine state".
* Update opengroup.org links to POSIX 2024Tavian Barnes2024-08-021-1/+1
|
* prelude: Simplify attributesTavian Barnes2024-07-281-7/+7
|
* Implement POSIX 2024's -mountTavian Barnes2024-07-081-4/+1
| | | | | | This reverts commit 4f80c17192f2b28c96a489969d4435151d68d0ce. Link: https://www.austingroupbugs.net/view.php?id=1133
* build: Rename CONFIG to CONFFLAGSTavian Barnes2024-06-181-6/+6
|
* build: Include CC in bfs --version outputTavian Barnes2024-06-131-0/+1
|
* Embed more configuration info in bfs --versionTavian Barnes2024-06-081-1/+10
|
* parse: Remove some unnecessary saving/restoring of errnoTavian Barnes2024-06-051-14/+0
|
* bfstd: New xstrtoll() wrapperTavian Barnes2024-06-041-15/+2
|
* parse: Allow -Darg/-Sarg as well as -D arg / -S argTavian Barnes2024-06-031-12/+20
|
* parse: Handle multiple flags at once like -LEXO2Tavian Barnes2024-06-031-26/+138
| | | | | | | | | | | | | | | | | | | | | The POSIX Utility Syntax Guidelines specify that flag groups like -HL should be handled like -H -L. GNU find doesn't support grouping flags in this way, but BSD find does. To avoid conflicts with non-flag primaries, for now we require at least one flag in a group to be a capital letter. That is, we support things like -Lds but not -ds. We also do not support -fPATH (without a space) as it would conflict with -follow, -fprint, etc. It is impossible to be compatible with both GNU and BSD find here: user@gnu$ find -follow link link/file ... user@bsd$ find -follow find: ollow: No such file or directory Link: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
* Implement the remaining regex typesTavian Barnes2024-05-281-6/+26
| | | | Closes: https://github.com/tavianator/bfs/issues/21
* configure: Use --with/--without for librariesTavian Barnes2024-05-241-2/+2
|
* expr: New for_expr macroTavian Barnes2024-05-231-1/+1
|
* Stop using %mTavian Barnes2024-05-201-7/+7
|
* config: Check for struct tm::tm_gmtoffTavian Barnes2024-04-191-1/+1
|
* Rename config.h to prelude.hTavian Barnes2024-04-191-1/+1
|
* Implement -contextTavian Barnes2024-04-101-48/+66
| | | | Closes: https://github.com/tavianator/bfs/issues/27
* build: Add a separate configuration stepTavian Barnes2024-04-091-1/+1
|
* Implement -limit NTavian Barnes2024-03-201-1/+37
| | | | Closes: https://github.com/tavianator/bfs/issues/133
* Re-run include-what-you-useTavian Barnes2024-03-111-2/+1
|
* xtime: Call tzset() from main() instead of lazilyTavian Barnes2024-03-071-6/+6
| | | | | | | | | | | | | POSIX specifies[1] that If a thread accesses tzname, daylight, or timezone directly while another thread is in a call to tzset(), or to any function that is required or allowed to set timezone information as if by calling tzset(), the behavior is undefined. So calling it lazily from arbitrary threads is risky. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/tzset.html
* sanity: Don't use self-init for uninit()Tavian Barnes2024-02-121-4/+4
| | | | | | | | | | | Self-initialization like bool ret = ret; is a GCC trick to suppress uninitialized variable warnings, but it's not actually well-defined, and will trip a recent enough MemorySanitizer: src/eval.c:1088:13: runtime error: load of value 128, which is not a valid value for type 'bool'
* ctx: Fill in ctx->threads earlierTavian Barnes2024-02-061-4/+2
|
* expr: Make expressions variadicTavian Barnes2024-01-071-48/+25
| | | | | | | | | Rather than only unary/binary expressions, we now support an arbitrary number of children. The optimizer has been re-written almost completely and now supports optimal reordering of longer expression chains, rather than just arm-swapping. Fixes #85.
* expr: Arena-allocate expressionsTavian Barnes2023-12-201-208/+132
|
* parse: s/parser_state/bfs_parser/Tavian Barnes2023-12-201-476/+476
|
* expr: Move some implementation into expr.cTavian Barnes2023-12-201-45/+0
|
* config: s/attr_format/attr_printf/Tavian Barnes2023-12-181-7/+7
|
* config: New variadic attr(...) macroTavian Barnes2023-12-181-7/+7
|
* parse: Reject integers that start with whitespaceTavian Barnes2023-12-091-1/+5
|
* ctx: Switch paths from darray to RESERVE()Tavian Barnes2023-11-231-10/+10
|
* config: s/BFS_FORMATTER/attr_format/Tavian Barnes2023-11-091-7/+7
|
* parse: Reject -{exec,ok}dir if $PATH contains a relative pathTavian Barnes2023-11-071-0/+26
| | | | This matches the behaviour of GNU find.
* Treat NO_COLOR="" the same as unsetTavian Barnes2023-11-061-1/+2
| | | | | | | | | | | | | | The docs say > Command-line software which adds ANSI color to its output by default > should check for a NO_COLOR environment variable that, when present > and not an empty string (regardless of its value), prevents the > addition of ANSI color. but we were not checking for the empty string. Link: https://no-color.org/ Link: https://github.com/sharkdp/fd/pull/1421
* bfstd: New xwaitpid() wrapperTavian Barnes2023-10-311-1/+1
|
* parse: Set BFTW_WHITEOUTS when parsing -type wTavian Barnes2023-10-171-0/+3
|
* bfstd: Add a thread-safe wrapper for strerror()Tavian Barnes2023-10-051-2/+2
|
* Formatting fixesTavian Barnes2023-09-271-23/+22
|
* parse: Give more ephemeral_fds to -no{user,group}Tavian Barnes2023-09-121-7/+9
| | | | | | | | Fewer than 3 can lead to Assertion failed: (retval->write_queue != -1), function __open_cached_connection, file /usr/src/lib/libc/net/nscachedcli.c, line 224. on a FreeBSD system with LDAP accounts.