From edd8b5e081878fcb5508ab3357607d820b341ac0 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Tue, 18 Apr 2017 10:39:26 -0400
Subject: [PATCH] FStream: Open files on Windows using UNC path

This will allow long file paths to be accessed.
---
 FStream.hxx.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/FStream.hxx.in b/FStream.hxx.in
index d4bc6c9..a4c65fe 100644
--- a/FStream.hxx.in
+++ b/FStream.hxx.in
@@ -33,7 +33,7 @@ public:
   typedef std::basic_filebuf<CharType, Traits> my_base_type;
   basic_filebuf* open(char const* s, std::ios_base::openmode mode)
   {
-    const std::wstring wstr = Encoding::ToWide(s);
+    const std::wstring wstr = Encoding::ToWindowsExtendedPath(s);
     return static_cast<basic_filebuf*>(my_base_type::open(wstr.c_str(), mode));
   }
 #endif
@@ -93,7 +93,7 @@ public:
 #if defined(_MSC_VER)
     const bool success = buf_->open(file_name, mode) != 0;
 #else
-    const std::wstring wstr = Encoding::ToWide(file_name);
+    const std::wstring wstr = Encoding::ToWindowsExtendedPath(file_name);
     bool success = false;
     std::wstring cmode = getcmode(mode);
     file_ = _wfopen(wstr.c_str(), cmode.c_str());
-- 
GitLab