[llvm-commits] [llvm] r138213 - /llvm/trunk/lib/Support/Windows/PathV2.inc

Aaron Ballman aaron at aaronballman.com
Tue Aug 23 15:03:15 PDT 2011


On Mon, Aug 22, 2011 at 10:39 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
>>> Nitpick: Shall we handle "x:\path\to\com9.txt" here?
>>
>> I could certainly add that.  Do we link against shlwapi.lib (available
>> in Win2k and higher) so that I can use PathFindFileName?  Or should I
>> prefer our filename function from PathV2.cpp (this one only worries me
>> in case we accidentally run into infinite loops at some point)?
>
> I think it would be enough to use PathV2 itself to parse path. Using
> shell api might be overkill (and useless).
> Note: "x:\path\to\com9.txt" is mapped to the device namespace.

I've attached a patch to address this so that we now use the path
"stem" to do the comparison.  This means we'll catch DOS device names
like "com9" as well as ill-named compete paths like
x:\path\to\com9.txt.

Additionally, I addressed your suggestion about the static declaration
using array notation instead of pointer notation.  However, I'd be
curious to hear why you have this preference (you could email me
off-list if you'd prefer).

Thanks!

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PathV2.diff
Type: application/octet-stream
Size: 1319 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110823/a1604485/attachment.obj>


More information about the llvm-commits mailing list