|
|
eb8b6e |
From 5a45664f9b5d2ba7550ed1c12550554688b70f5c Mon Sep 17 00:00:00 2001
|
|
|
eb8b6e |
From: Frantisek Sumsal <frantisek@sumsal.cz>
|
|
|
eb8b6e |
Date: Mon, 29 Nov 2021 13:47:24 +0100
|
|
|
eb8b6e |
Subject: [PATCH] test,systemctl: use "const char*" instead of "char*"
|
|
|
eb8b6e |
|
|
|
eb8b6e |
as iterator for FOREACH_STRING()
|
|
|
eb8b6e |
|
|
|
eb8b6e |
The macro iterates through literal strings (i.e. constant strings),
|
|
|
eb8b6e |
hence it's more correct to have the iterator const too.
|
|
|
eb8b6e |
|
|
|
eb8b6e |
Based on b2238e380e5f2fbcc129643b3fbd66f2828fd57c.
|
|
|
eb8b6e |
|
|
|
eb8b6e |
(cherry picked from commit fdfff847313222eed3306ac605db46d8cbd23212)
|
|
|
eb8b6e |
|
|
|
eb8b6e |
Related: #2039327
|
|
|
eb8b6e |
---
|
|
|
eb8b6e |
src/systemctl/systemctl.c | 3 ++-
|
|
|
eb8b6e |
src/test/test-execute.c | 2 +-
|
|
|
eb8b6e |
2 files changed, 3 insertions(+), 2 deletions(-)
|
|
|
eb8b6e |
|
|
|
eb8b6e |
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
|
|
|
eb8b6e |
index 3dd7c1522f..b967550b97 100644
|
|
|
eb8b6e |
--- a/src/systemctl/systemctl.c
|
|
|
eb8b6e |
+++ b/src/systemctl/systemctl.c
|
|
|
eb8b6e |
@@ -7011,7 +7011,8 @@ static int run_editor(char **paths) {
|
|
|
eb8b6e |
if (r == 0) {
|
|
|
eb8b6e |
const char **args;
|
|
|
eb8b6e |
char *editor, **editor_args = NULL;
|
|
|
eb8b6e |
- char **tmp_path, **original_path, *p;
|
|
|
eb8b6e |
+ char **tmp_path, **original_path;
|
|
|
eb8b6e |
+ const char *p;
|
|
|
eb8b6e |
size_t n_editor_args = 0, i = 1;
|
|
|
eb8b6e |
size_t argc;
|
|
|
eb8b6e |
|
|
|
eb8b6e |
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
|
|
|
eb8b6e |
index 294f8fe7dd..4d21301982 100644
|
|
|
eb8b6e |
--- a/src/test/test-execute.c
|
|
|
eb8b6e |
+++ b/src/test/test-execute.c
|
|
|
eb8b6e |
@@ -146,7 +146,7 @@ invalid:
|
|
|
eb8b6e |
}
|
|
|
eb8b6e |
|
|
|
eb8b6e |
static bool is_inaccessible_available(void) {
|
|
|
eb8b6e |
- char *p;
|
|
|
eb8b6e |
+ const char *p;
|
|
|
eb8b6e |
|
|
|
eb8b6e |
FOREACH_STRING(p,
|
|
|
eb8b6e |
"/run/systemd/inaccessible/reg",
|