aboutsummaryrefslogtreecommitdiff
path: root/find.cc
diff options
context:
space:
mode:
Diffstat (limited to 'find.cc')
-rw-r--r--find.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/find.cc b/find.cc
index f7e7508..bc83b5f 100644
--- a/find.cc
+++ b/find.cc
@@ -539,6 +539,8 @@ class FindCommandParser {
if (!GetNextToken(&tok) || !tok.empty())
return false;
return true;
+ } else {
+ return false;
}
}
}
@@ -676,8 +678,10 @@ FindCommand::FindCommand()
bool FindCommand::Parse(const string& cmd) {
FindCommandParser fcp(cmd, this);
- if (cmd.find("find ") == string::npos)
+ size_t found = cmd.find("find ");
+ if (found == string::npos || (found != 0 && !isspace(cmd[found-1]))) {
return false;
+ }
if (!fcp.Parse())
return false;