mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 20:22:31 +00:00
* Some views were using uninitialized bool for reversing.
* Possibly hash_done gets called while a download is closed. * Consider putting chunk release before receive_chunkdone. * Don't use getopt to check for flags as that re-orders the left-over arguments. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@696 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+5
-10
@@ -36,7 +36,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <functional>
|
||||
#include <getopt.h>
|
||||
#include <stdexcept>
|
||||
#include <unistd.h>
|
||||
@@ -88,17 +91,9 @@ OptionParser::process(int argc, char** argv) {
|
||||
|
||||
bool
|
||||
OptionParser::has_flag(char flag, int argc, char** argv) {
|
||||
int result;
|
||||
char options[2] = { flag, '\0' };
|
||||
char options[3] = { '-', flag, '\0' };
|
||||
|
||||
optind = 0;
|
||||
opterr = 0;
|
||||
|
||||
while ((result = getopt(argc, argv, options)) != -1)
|
||||
if (result == flag)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return std::find_if(argv, argv + argc, std::not1(std::bind1st(std::ptr_fun(&std::strcmp), options))) != argv + argc;
|
||||
}
|
||||
|
||||
std::string
|
||||
|
||||
Reference in New Issue
Block a user