From d4f87ce29ffaa5a373c90f03b31d8050343cf1a8 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 5 Feb 2015 21:31:16 +0900 Subject: [PATCH] nghttpd: Fix multiple push configuration does not work --- src/nghttpd.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nghttpd.cc b/src/nghttpd.cc index a8c17a03..7cb9d0e6 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -49,15 +49,15 @@ namespace nghttp2 { namespace { int parse_push_config(Config &config, const char *optarg) { - const char *eq = strchr(optarg, '='); + const auto eq = strchr(optarg, '='); if (eq == NULL) { return -1; } - auto paths = std::vector(); + auto &paths = config.push[std::string(optarg, eq)]; auto optarg_end = optarg + strlen(optarg); - const char *i = eq + 1; + auto i = eq + 1; for (;;) { - const char *j = strchr(i, ','); + auto j = strchr(i, ','); if (j == NULL) { j = optarg_end; } @@ -68,7 +68,7 @@ int parse_push_config(Config &config, const char *optarg) { i = j; ++i; } - config.push[std::string(optarg, eq)] = std::move(paths); + return 0; } } // namespace