feat: warn when creating torrents with nonportable filenames (#2695)

* feat: check new torrents for nonportable filenames

* fix: parse torrents even if they have nonportable filenames in the info dict's 'file' string
This commit is contained in:
Charles Kerr
2022-02-23 17:38:07 -06:00
committed by GitHub
parent 706735ca88
commit cfb92c47f0
8 changed files with 139 additions and 71 deletions
+8
View File
@@ -208,6 +208,14 @@ int tr_main(int argc, char* argv[])
return EXIT_FAILURE;
}
for (uint32_t i = 0; i < b->fileCount; ++i)
{
if (auto const& file = b->files[i]; !file.is_portable)
{
fprintf(stderr, "WARNING: consider renaming nonportable filename \"%s\".\n", file.filename);
}
}
if (options.piecesize_kib != 0)
{
tr_metaInfoBuilderSetPieceSize(b, options.piecesize_kib * KiB);