1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 11_FixOptionContainer.cpp_on_arm.dpatch by Alexander Wirt <formorer@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: If you need to iterate through all lines in the
6
## config file to find a field, at least don't abuse the configfile deque
7
## by accessing it as if it was an array with signed index.
8
## Works way better on arm, too, i.e. closes: #493047.
11
diff -urNad dansguardian-2.9.9.7~/src/OptionContainer.cpp dansguardian-2.9.9.7/src/OptionContainer.cpp
12
--- dansguardian-2.9.9.7~/src/OptionContainer.cpp 2008-08-18 09:57:46.000000000 +0200
13
+++ dansguardian-2.9.9.7/src/OptionContainer.cpp 2008-10-13 09:23:20.000000000 +0200
18
- for (int i = 0; i < (signed) conffile.size(); i++) {
19
- temp = conffile[i].c_str();
20
+ for (std::deque<std::string>::iterator i = conffile.begin(); i != conffile.end(); i++) {
23
+ temp = (*i).c_str();
24
temp2 = temp.before("=");
25
while (temp2.endsWith(" ")) { // get rid of tailing spaces before =
30
std::deque<String > results;
31
- for (int i = 0; i < (signed) conffile.size(); i++) {
32
- temp = conffile[i].c_str();
33
+ for (std::deque<std::string>::iterator i = conffile.begin(); i != conffile.end(); i++) {
36
+ temp = (*i).c_str();
37
temp2 = temp.before("=");
38
while (temp2.endsWith(" ")) { // get rid of tailing spaces before =