From fc4f4a9753318c9e278be2ee47f169a230a8ba7d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 13 Mar 2012 04:44:40 +0000 Subject: [PATCH] fix non-unc build --- src/torrent_info.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index 78986d81e..0b29b4e50 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -234,7 +234,9 @@ namespace libtorrent int num_names = sizeof(reserved_names)/sizeof(reserved_names[0]); char const* file_end = strrchr(pe.c_str(), '.'); - std::string name(pe.c_str(), file_end); + std::string name; + if (file_end) name.assign(pe.c_str(), file_end); + else name = pe; std::transform(name.begin(), name.end(), name.begin(), &to_lower); char const** str = std::find(reserved_names, reserved_names + num_names, name); if (str != reserved_names + num_names)