It need to convert wchar[] to string.

On 27 mar 2013, at 13:10, JakobOvrum <notifications@github.com> wrote:

> In std/process.d:
> 
> > +
> > +    @trusted string getProcessPath ()
> > +    {
> > +        static wchar[MAX_PATH + 1] stackBuffer;
> > +        wchar[] buffer = stackBuffer[];
> > +        auto len = GetModuleFileNameW(null, buffer.ptr, buffer.length - 1);
> > +        errnoEnforce(len);
> > +
> > +        while (GetLastError() == ERROR_INSUFFICIENT_BUFFER)
> > +        {
> > +            buffer.length *= 2;
> > +            len = GetModuleFileNameW(null, buffer.ptr, buffer.length - 1);
> > +            errnoEnforce(len);
> > +        }
> > +
> > +        return to!(string)(buffer[0 .. len]);
> If the buffer was dynamically allocated (because the first call failed), there should be no need to make a copy here.
> 
> —
> Reply to this email directly or view it on GitHub.
> 

-- 
/Jacob Carlborg