util: new function unquote()

Refactor to reduce code duplication

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2025-07-02 14:28:10 +02:00
1 parent ecb690c9ec
commit 6f0ba22a0f
4 files changed
+26 -28

No files matched your search

+1 -8
View File
@@ -460,14 +460,7 @@ static void source_env(svc_t *svc)
value++;
/* unquote value, if quoted */
if (value[0] == '"' || value[0] == '\'') {
char q = value[0];
if (*end == q) {
value = &value[1];
*end = 0;
}
}
unquote(&value, end);
/* find end of key */
end = key;