mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
util: add streq() function and use in place of strcmp(...) == 0
This commit is contained in:
parent
44c0cf594b
commit
e0f3703ae6
16 changed files with 172 additions and 165 deletions
8
client.c
8
client.c
|
|
@ -315,11 +315,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);
|
||||
|
|
@ -419,7 +419,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue