[PATCH] D27475: [libFuzzer] Diff 17 - Implement DirName() for Windows.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 14:49:23 PST 2016


mpividori updated this revision to Diff 80490.

Repository:
  rL LLVM

https://reviews.llvm.org/D27475

Files:
  lib/Fuzzer/FuzzerIOWindows.cpp


Index: lib/Fuzzer/FuzzerIOWindows.cpp
===================================================================
--- lib/Fuzzer/FuzzerIOWindows.cpp
+++ lib/Fuzzer/FuzzerIOWindows.cpp
@@ -21,6 +21,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <windows.h>
+#include <Shlwapi.h>
 
 namespace fuzzer {
 
@@ -140,7 +141,10 @@
 }
 
 std::string DirName(const std::string &FileName) {
-  assert(0 && "Unimplemented");
+  std::string Res = FileName;
+  PathRemoveFileSpecA(&Res[0]);
+  Res.resize(std::strlen(Res.c_str()));
+  return Res;
 }
 
 }  // namespace fuzzer


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27475.80490.patch
Type: text/x-patch
Size: 569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161206/847b8130/attachment.bin>


More information about the llvm-commits mailing list