소스 검색

BUG: Trust user-provided source file full paths.

Brad King 17 년 전
부모
커밋
b69cfaf412
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      Source/cmSourceFile.cxx

+ 10 - 0
Source/cmSourceFile.cxx

@@ -167,6 +167,16 @@ bool cmSourceFile::FindFullPath()
       }
     }
 
+  // If the user provided a full path, trust it.  If the file is not
+  // there the native tool will complain at build time.
+  if(!this->Location.DirectoryIsAmbiguous())
+    {
+    this->FullPath = this->Location.GetDirectory();
+    this->FullPath += "/";
+    this->FullPath += this->Location.GetName();
+    return true;
+    }
+
   cmOStringStream e;
   e << "Cannot find source file \"" << this->Location.GetName() << "\"";
   e << "\n\nTried extensions";