mirror of
https://github.com/troglobit/finit.git
synced 2026-10-21 11:29:42 +00:00
util: new function unquote()
Refactor to reduce code duplication Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
4 files changed
+26
-28
No files matched your search
+1
-8
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user