Boost logo

Boost :

Subject: Re: [boost] [filesystem][lexical_cast] Lexical cast of filenames containing spaces
From: Daniel James (dnljms_at_[hidden])
Date: 2010-08-15 03:48:23


On 14 August 2010 15:27, Dmitry Goncharov <dgoncharov_at_[hidden]> wrote:
>
> This bug was fixed two month ago.
> Have a look https://svn.boost.org/trac/boost/ticket/3863

No, that's what caused this problem. What happens is that you when run
a program that uses program_options, the shell unquotes the arguments,
so an argument with a space in is not quoted. Then program options
calls lexical_cast to convert the argument from a string to a
filesystem path. Lexical cast uses filesystem's stream extractor to
perform this conversion. But since there's a space, it only extracts
part of the file name. Lexical cast notices that only some of the
string has been extracted, realises that something has gone wrong and
throws an exception.

There's also a double unencoding issue if the file's name contains quotes.

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk