Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75631 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-11-22 18:50:33


Author: danieljames
Date: 2011-11-22 18:50:32 EST (Tue, 22 Nov 2011)
New Revision: 75631
URL: http://svn.boost.org/trac/boost/changeset/75631

Log:
Quickbook: Allocate correctly sized buffer for cygwin.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/input_path.cpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/input_path.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/input_path.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/input_path.cpp 2011-11-22 18:50:32 EST (Tue, 22 Nov 2011)
@@ -113,13 +113,13 @@
         if (size < 0)
             throw conversion_error("Error converting cygwin path to windows.");
 
- // TODO: size is in bytes.
- boost::scoped_array<wchar_t> result(new wchar_t[size]);
+ boost::scoped_array<char> result(new char[size]);
+ void* ptr = result.get();
 
- if(cygwin_conv_path(flags, path.c_str(), result.get(), size))
+ if(cygwin_conv_path(flags, path.c_str(), ptr, size))
             throw conversion_error("Error converting cygwin path to windows.");
 
- return fs::path(result.get());
+ return fs::path(static_cast<wchar_t*>(ptr));
     }
     
     stream_string path_to_stream(fs::path const& path)


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk