Made find() return -1 if not found.
This commit is contained in:
parent
d7ef47cd49
commit
75df8d0282
@ -412,8 +412,7 @@ namespace coreutils {
|
|||||||
++temp2;
|
++temp2;
|
||||||
if(cursor > (data + length)) {
|
if(cursor > (data + length)) {
|
||||||
cursor = temp;
|
cursor = temp;
|
||||||
count = 0;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cursor = temp2;
|
cursor = temp2;
|
||||||
|
@ -95,4 +95,9 @@ int main(int argc, char **argv) {
|
|||||||
coreutils::ZString test17(" hello there ");
|
coreutils::ZString test17(" hello there ");
|
||||||
std::cout << "[" << test17.trim() << "]" << std::endl;
|
std::cout << "[" << test17.trim() << "]" << std::endl;
|
||||||
|
|
||||||
|
coreutils::ZString test18("this.test");
|
||||||
|
std::cout << "[" << test18.find(".") << "] " << test18.parsed() << ":" << test18.unparsed() << std::endl;
|
||||||
|
test18.reset();
|
||||||
|
std::cout << "[" << test18.find("x") << "] " << test18.parsed() << ":" << test18.unparsed() << std::endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user