]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
creds: use parse_tristate_argument_with_auto() where appropriate
authorMike Yuan <me@yhndnzj.com>
Wed, 25 Mar 2026 14:39:26 +0000 (15:39 +0100)
committerMike Yuan <me@yhndnzj.com>
Thu, 26 Mar 2026 14:55:50 +0000 (15:55 +0100)
src/creds/creds.c

index 5f60f781f6c45a9c2093bf1317d0db26a5d6d2f8..9e1b2cfbcc46f4c32810f7ce24e9721786ae856d 100644 (file)
@@ -940,15 +940,9 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_NEWLINE:
-                        if (isempty(optarg) || streq(optarg, "auto"))
-                                arg_newline = -1;
-                        else {
-                                r = parse_boolean_argument("--newline=", optarg, NULL);
-                                if (r < 0)
-                                        return r;
-
-                                arg_newline = r;
-                        }
+                        r = parse_tristate_argument_with_auto("--newline=", optarg, &arg_newline);
+                        if (r < 0)
+                                return r;
                         break;
 
                 case 'p':