diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-12-30 14:49:46 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-01-19 14:41:55 -0500 |
commit | 683552c4c9a3dfee4ce603157bb2cf18d64fbcfc (patch) | |
tree | 475130eeb136007eea7c59cb7190dc05287e2c56 /src/parse.c | |
parent | 944cd72f40a84d318453c320a84d443273956859 (diff) | |
download | bfs-683552c4c9a3dfee4ce603157bb2cf18d64fbcfc.tar.xz |
bfstd: New wrappers for dirname()/basename()
Diffstat (limited to 'src/parse.c')
-rw-r--r-- | src/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/parse.c b/src/parse.c index ad32714..51a9d0a 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2888,7 +2888,8 @@ static CFILE *launch_pager(pid_t *pid, CFILE *cout) { NULL, }; - if (strcmp(xbasename(exe), "less") == 0) { + const char *cmd = exe + xbaseoff(exe); + if (strcmp(cmd, "less") == 0) { // We know less supports colors, other pagers may not ret->colors = cout->colors; argv[1] = "-FKRX"; @@ -3931,7 +3932,8 @@ struct bfs_ctx *bfs_parse_cmdline(int argc, char *argv[]) { .now = ctx->now, }; - if (strcmp(xbasename(state.command), "find") == 0) { + const char *cmd = state.command + xbaseoff(state.command); + if (strcmp(cmd, "find") == 0) { // Operate depth-first when invoked as "find" ctx->strategy = BFTW_DFS; } |