From 967adf0de55afcb52881cdb1a7b16788c7c283db Mon Sep 17 00:00:00 2001 From: ipknHama Date: Sun, 28 Aug 2016 14:46:31 +0900 Subject: Add websocket feature --- include/mustache.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/mustache.h') diff --git a/include/mustache.h b/include/mustache.h index b596b45..279f356 100644 --- a/include/mustache.h +++ b/include/mustache.h @@ -520,7 +520,11 @@ namespace crow inline std::string default_loader(const std::string& filename) { - std::ifstream inf(detail::get_template_base_directory_ref() + filename); + std::string path = detail::get_template_base_directory_ref(); + if (!(path.back() == '/' || path.back() == '\\')) + path += '/'; + path += filename; + std::ifstream inf(path); if (!inf) return {}; return {std::istreambuf_iterator(inf), std::istreambuf_iterator()}; -- cgit v1.2.3-54-g00ecf