* 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:
rakshasa
2006-05-21 00:11:07 +00:00
parent 271e8e6ccf
commit 770d205b9a
4 changed files with 28 additions and 30 deletions
+5 -10
View File
@@ -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