{
{ 'm', "magnet", "Give a magnet link for the specified torrent", "m", 0, NULL },
{ 's', "scrape", "Ask the torrent's trackers how many peers are in the torrent's swarm", "s", 0, NULL },
+ { 'u', "unsorted", "Do not sort files by name", "u", 0, NULL },
{ 'V', "version", "Show version number and exit", "V", 0, NULL },
{ 0, NULL, NULL, NULL, 0, NULL }
};
static bool magnetFlag = false;
static bool scrapeFlag = false;
+static bool unsorted = false;
static bool showVersion = false;
char const* filename = NULL;
scrapeFlag = true;
break;
+ case 'u':
+ unsorted = true;
+ break;
+
case 'V':
showVersion = true;
break;
{
files[i] = &inf->files[i];
}
-
- qsort(files, inf->fileCount, sizeof(tr_file*), compare_files_by_name);
+
+ if (!unsorted)
+ {
+ qsort(files, inf->fileCount, sizeof(tr_file*), compare_files_by_name);
+ }
for (unsigned int i = 0; i < inf->fileCount; ++i)
{