diff --git a/src/cfgprint.c b/src/cfgprint.c index 6652d47d..00aaf58d 100644 --- a/src/cfgprint.c +++ b/src/cfgprint.c @@ -70,12 +70,15 @@ static void fwup_cfg_opt_nprint_var(cfg_opt_t *opt, unsigned int index, struct s case CFGT_STR: { const char *str = cfg_opt_getnstr(opt, index); + // Fwup's feature of re-evaluating strings when applying firmware + // updates is a feature and used to modify behavior when applying + // firmware updates (aka runtime). Fwup has always escaped double + // quotes, though, since it really messes up error messages when + // double quotes aren't escaped. ssprintf(s, "\""); while (str && *str) { if (*str == '"') ssprintf(s, "\\\""); - else if (*str == '\\') - ssprintf(s, "\\\\"); else ssprintf(s, "%c", *str); str++; diff --git a/tests/004_env_vars.test b/tests/004_env_vars.test index 64d7cdad..89ac3c6f 100755 --- a/tests/004_env_vars.test +++ b/tests/004_env_vars.test @@ -16,6 +16,12 @@ cat >"$CONFIG" <"$EXPECTED_META_CONF" <$CONFIG <$EXPECTED_META_CONF <