瀏覽代碼

cmake: Teach "-E tar" to report file name on failure to read from disk

The libarchive-provided error message does not always include the file
name, so add it to the message ourselves to ensure users know which file
fails.
Brad King 11 年之前
父節點
當前提交
90f9c42732
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      Source/cmArchiveWrite.cxx

+ 3 - 1
Source/cmArchiveWrite.cxx

@@ -271,7 +271,9 @@ bool cmArchiveWrite::AddFile(const char* file,
   cm_archive_entry_copy_pathname(e, dest);
   if(archive_read_disk_entry_from_file(this->Disk, e, -1, 0) != ARCHIVE_OK)
     {
-    this->Error = "archive_read_disk_entry_from_file: ";
+    this->Error = "archive_read_disk_entry_from_file '";
+    this->Error += file;
+    this->Error += "': ";
     this->Error += cm_archive_error_string(this->Disk);
     return false;
     }