Ver código fonte

Merge pull request #17607 from RandomShaper/fix-bogus-file-in-pack

Fix listing files inside directory in pack file
Rémi Verschelde 7 anos atrás
pai
commit
b49ca9486c
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      core/io/file_access_pack.cpp

+ 5 - 1
core/io/file_access_pack.cpp

@@ -88,7 +88,11 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o
 				}
 			}
 		}
-		cd->files.insert(path.get_file());
+		String filename = path.get_file();
+		// Don't add as a file if the path points to a directoryy
+		if (!filename.empty()) {
+			cd->files.insert(filename);
+		}
 	}
 }