title: When resolving a symlink with boost the result doesn't equal the original path name
body: <p>Windows 10<br>
  MS VS 2015<br>
  C++11<br>
  Boost 1.60  </p>
  
  <p>I create this symbolic link:</p>
  
  <p><code>mklink /J "C:\T4 2.0\ApplicationSymlinks\T4"  "C:\T4 2.0\Data"</code></p>
  
  <p>This is a much simplified version of a program to check if the symbolic link is linked to the proper directory:</p>
  
  <pre><code>#include &lt;boost/filesystem.hpp&gt;
  #include &lt;iostream&gt;
  int main()
  {
      boost::filesystem::path directory = "c:\\T4 2.0\\Data";
  
      boost::filesystem::path symlink = "c:\\T4 2.0\\ApplicationSymlinks\\T4";
      boost::filesystem::path path_linked_to("");
      path_linked_to = boost::filesystem::read_symlink(symlink);    // Resolve symlink. path_linked_to is not absolute. L"\\T4 2.0\\Data"
      path_linked_to = boost::filesystem::absolute(path_linked_to); // Absolute path. L"c:\\T4 2.0\\Data"
  
      if (directory == path_linked_to)
          std::cout &lt;&lt; "paths are equal" &lt;&lt; std::endl;
      else
          std::cout &lt;&lt; "paths are not equal" &lt;&lt; std::endl;                    
      return 0;
  }
  </code></pre>
  
  <p>The output is "paths are not equal". Shouldn't they be equal? In the autos window of the debugger I do see this:</p>
  
  <pre><code>directory size 14 capacity 15
  </code></pre>
  
  <p>where as</p>
  
  <pre><code>path_linked_to size 16 capacity 23 because it includes two trailing '\0's.
  </code></pre>
  
  <p>These two trailing <code>'\0'</code>s are introduced in <code>read_symlink</code>.</p>
  
  <p>How do I resolve this? Why doesn't <code>read_symlink</code> return an absolute? Why does <code>read_symlink</code> add in two trailing <code>'\0'</code>s (assuming that is the problem)? Why does <code>operator==</code> not ignore the <code>'\0'</code>s?</p>
  
  <p>How I compiled and linked:</p>
  
  <pre><code>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\CL.exe /c /IC:\Libraries\boost_1_60_0 /ZI /nologo /W3 /WX- /sdl /Od /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Debug\\" /Fd"x64\Debug\vc140.pdb" /Gd /TP /errorReport:prompt resolvesymlilnk.cpp stdafx.cpp
  
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:PROMPT /OUT:"c:\Users\Therefore\Documents\Visual Studio 2015\Projects\resolvesymlilnk\x64\Debug\resolvesymlilnk.exe" /INCREMENTAL /NOLOGO /LIBPATH:"C:\Libraries\boost_1_60_0\lib64-msvc-14.0" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug /PDB:"c:\Users\Therefore\Documents\Visual Studio 2015\Projects\resolvesymlilnk\x64\Debug\resolvesymlilnk.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"c:\Users\Therefore\Documents\Visual Studio 2015\Projects\resolvesymlilnk\x64\Debug\resolvesymlilnk.lib" /MACHINE:X64 x64\Debug\resolvesymlilnk.obj
  </code></pre>