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
@@ -527,14 +527,7 @@ static void parse_env(char *line)
val++;
/* unquote value, if quoted */
if (val[0] == '"' || val[0] == '\'') {
char q = val[0];
if (*end == q) {
val = &val[1];
*end = 0;
}
}
unquote(&val, end);
/* find end of key */
end = key;