Subject: Re: [boost] [filesystem.v3] possible bug in replace_extension
From: Frédéric Bron (frederic.bron_at_[hidden])
Date: 2012-02-10 17:05:47
> I ran into this today. The issue is that replace_extension() extracts the extension() from its argument and uses that as the new extension. Thus, if there's no dot in the argument, it has no extension. That's reasonable for a path argument. Indeed, I think the patch is wrong.
> The confusion comes when the argument is a string. An implicit path is constructed from the string and, since it has no dot, there's no extension to replace. I think there should be an overload that takes a string. Then, the whole argument is used as the extension, if it contains no dot, and the tail is used if there is. Reasonable?
And this explains why it worked perfectly with v2 which used a string
Thanks for looking at this.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk