summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2010-07-06 21:05:06 +0000
committerChris Wilson <chris+github@qwirx.com>2010-07-06 21:05:06 +0000
commitce6beccb0639bd0ad769ba84c2b47d6c9f18dabe (patch)
treeaa3e35ea05f67197757421bdc0aeb854af8568b7
parent0df8f1966b4de3799a67b7e58764bbe6c4002dd0 (diff)
Fix Windows compile errors.
-rw-r--r--bin/bbackupquery/BackupQueries.cpp4
-rw-r--r--bin/bbackupquery/BackupQueries.h2
-rw-r--r--bin/bbackupquery/bbackupquery.cpp20
3 files changed, 22 insertions, 4 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp
index e488823d..c7dd82c2 100644
--- a/bin/bbackupquery/BackupQueries.cpp
+++ b/bin/bbackupquery/BackupQueries.cpp
@@ -199,7 +199,7 @@ BackupQueries::ParseCommand(const std::string& Command, bool isFromCommandLine)
GetConsoleCP()))
{
BOX_ERROR("Failed to convert encoding");
- return;
+ parsed.failed = true;
}
parsed.completeCommand = converted;
@@ -212,7 +212,7 @@ BackupQueries::ParseCommand(const std::string& Command, bool isFromCommandLine)
GetConsoleCP()))
{
BOX_ERROR("Failed to convert encoding");
- return;
+ parsed.failed = true;
}
*i = converted;
diff --git a/bin/bbackupquery/BackupQueries.h b/bin/bbackupquery/BackupQueries.h
index 4651cd9e..5d562103 100644
--- a/bin/bbackupquery/BackupQueries.h
+++ b/bin/bbackupquery/BackupQueries.h
@@ -89,6 +89,8 @@ public:
std::vector<std::string> cmdElements;
std::string options;
std::string completeCommand;
+ bool failed;
+ ParsedCommand() : failed(false) { }
};
ParsedCommand ParseCommand(const std::string& Command,
diff --git a/bin/bbackupquery/bbackupquery.cpp b/bin/bbackupquery/bbackupquery.cpp
index 7726f429..90fa74b5 100644
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -447,7 +447,15 @@ int main(int argc, const char *argv[])
{
BackupQueries::ParsedCommand cmd(
context.ParseCommand(argv[c++], true));
- context.DoCommand(cmd);
+
+ if(cmd.failed)
+ {
+ BOX_ERROR("Parse failed");
+ }
+ else
+ {
+ context.DoCommand(cmd);
+ }
}
}
@@ -492,8 +500,16 @@ int main(int argc, const char *argv[])
BackupQueries::ParsedCommand cmd(
context.ParseCommand(command, false));
- context.DoCommand(cmd);
+ if(cmd.failed)
+ {
+ BOX_ERROR("Parse failed");
+ }
+ else
+ {
+ context.DoCommand(cmd);
+ }
+
if(last_cmd != 0 && ::strcmp(last_cmd, command) == 0)
{
free(command);