From fe7966ecee54df50b57bf3ccc65a50525d617c96 Mon Sep 17 00:00:00 2001 From: Christos Tsantilas Date: Thu, 13 Mar 2014 12:56:38 +0200 Subject: [PATCH] url_rewrite_extras and store_id_extras patch fixes Fixes to patch "Add url_rewrite_extras and store_id_extras for redirector and store_id helpers",r13308: - Fix cf_gen.cc:gen_conf(..) function to not escape quotes before write to conf file - The Format::Format name is used to inform the user about parsing problems. Fix the names of related objects for the new redirecor_extras and store_id_extras directives. - cf.data.pre: The NAME tag take as argument only the name of directive. Fix the new redirecor_extras and store_id_extras related tags. --- src/cf.data.pre | 4 ++-- src/cf_gen.cc | 4 ++-- src/redirect.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cf.data.pre b/src/cf.data.pre index 2a8ef198a8..194ee1696a 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -4755,7 +4755,7 @@ DOC_START be allowed to request. DOC_END -NAME: url_rewrite_extras format +NAME: url_rewrite_extras TYPE: TokenOrQuotedString LOC: Config.redirector_extras DEFAULT: "%>a/%>A %un %>rm myip=%la myport=%lp" @@ -4820,7 +4820,7 @@ DOC_START By default, a StoreID helper is not used. DOC_END -NAME: store_id_extras format +NAME: store_id_extras TYPE: TokenOrQuotedString LOC: Config.storeId_extras DEFAULT: "%>a/%>A %un %>rm myip=%la myport=%lp" diff --git a/src/cf_gen.cc b/src/cf_gen.cc index cdb3c38b4f..50a49ba33c 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -823,13 +823,13 @@ gen_conf(const EntryList &head, std::ostream &fout, bool verbose_output) if (entry->defaults.preset.size() && entry->defaults.preset.front().compare("none") != 0) { // Display DEFAULT: line(s) for (LineList::const_iterator l = entry->defaults.preset.begin(); l != entry->defaults.preset.end(); ++l) { - snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), gen_quote_escape(*l)); + snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), l->c_str()); def.push_back(buf); } } else if (entry->defaults.if_none.size()) { // Display DEFAULT_IF_NONE: line(s) for (LineList::const_iterator l = entry->defaults.if_none.begin(); l != entry->defaults.if_none.end(); ++l) { - snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), gen_quote_escape(*l)); + snprintf(buf, sizeof(buf), "%s %s", entry->name.c_str(), l->c_str()); def.push_back(buf); } } diff --git a/src/redirect.cc b/src/redirect.cc index 1ebd680d44..1c7fd18ff3 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -423,12 +423,12 @@ redirectInit(void) } if (Config.redirector_extras) { - redirectorExtrasFmt = new ::Format::Format("redirecor_extras"); + redirectorExtrasFmt = new ::Format::Format("url_rewrite_extras"); (void)redirectorExtrasFmt->parse(Config.redirector_extras); } if (Config.storeId_extras) { - storeIdExtrasFmt = new ::Format::Format("storeId_extras"); + storeIdExtrasFmt = new ::Format::Format("store_id_extras"); (void)storeIdExtrasFmt->parse(Config.storeId_extras); } -- 2.39.2