aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2024-01-24 23:17:28 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-02-05 11:09:52 +0000
commite0f3703ae6c4084f9275cfc78d87e5604cc27a10 (patch)
treecdfeebf67f6bb962c5543337b952fe6cf9d40587 /main.c
parentcsi: simplify handling of Set/Reset Mode (SM/RM) sequences (diff)
util: add streq() function and use in place of strcmp(...) == 0
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.c b/main.c
index f7cf8354..98db9c38 100644
--- a/main.c
+++ b/main.c
@@ -351,11 +351,11 @@ main(int argc, char *const *argv)
}
case 'l':
- if (optarg == NULL || strcmp(optarg, "auto") == 0)
+ if (optarg == NULL || streq(optarg, "auto"))
log_colorize = LOG_COLORIZE_AUTO;
- else if (strcmp(optarg, "never") == 0)
+ else if (streq(optarg, "never"))
log_colorize = LOG_COLORIZE_NEVER;
- else if (strcmp(optarg, "always") == 0)
+ else if (streq(optarg, "always"))
log_colorize = LOG_COLORIZE_ALWAYS;
else {
fprintf(stderr, "%s: argument must be one of 'never', 'always' or 'auto'\n", optarg);
@@ -538,7 +538,7 @@ main(int argc, char *const *argv)
if (resolved_path_cwd != NULL &&
resolved_path_pwd != NULL &&
- strcmp(resolved_path_cwd, resolved_path_pwd) == 0)
+ streq(resolved_path_cwd, resolved_path_pwd))
{
/*
* The resolved path of $PWD matches the resolved path of