[cfe-dev] [PATCH] Refactoring: fix making absolute FilePath in Replacement

Steffen Prohaska prohaska at zib.de
Mon Sep 1 14:21:01 PDT 2014


An std::error_code of 0 indicates success.  The condition must be reversed.

See diff below for http://llvm.org/svn/llvm-project/cfe/trunk

---

Hello,
I'm unsure whether this is the right way to submit a patch.  Please let me
know if I should prepare it in a different way.

Best,
  Steffen


Index: lib/Tooling/Refactoring.cpp
===================================================================
--- lib/Tooling/Refactoring.cpp	(revision 216889)
+++ lib/Tooling/Refactoring.cpp	(working copy)
@@ -111,7 +111,7 @@
     // relative paths for files are used.
     llvm::SmallString<256> FilePath(Entry->getName());
     std::error_code EC = llvm::sys::fs::make_absolute(FilePath);
-    this->FilePath = EC ? FilePath.c_str() : Entry->getName();
+    this->FilePath = (!EC) ? FilePath.c_str() : Entry->getName();
   } else {
     this->FilePath = InvalidLocation;
   }



More information about the cfe-dev mailing list