[llvm-commits] [llvm] r125228 - in /llvm/trunk: include/llvm/Support/PathV2.h lib/Support/Unix/PathV2.inc

Marius Wachtler undingen at gmail.com
Wed Feb 9 15:25:25 PST 2011


Hello

I think something like this should work for windows:

void canonical(const char *path, SmallVectorImpl<char> &buffer) {
  buffer.resize(MAX_PATH);
  if (PathCanonicalize(buffer.data(), path)) {
    buffer.resize(strlen(buffer.data())+1);
  }
}

But the problem is this adds an additional dependency on the
"shlwapi.lib" library.
I dont't know if this is okay that's way I haven't attached a full patch...

Another thing shouldn't the resize be length+1 to include the null character?

>size_t length = strlen(result);
>buffer.resize(length)

-- Marius



More information about the llvm-commits mailing list