summaryrefslogtreecommitdiff
path: root/plugins/MimCmd/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MimCmd/src')
-rw-r--r--plugins/MimCmd/src/MimCmd.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/plugins/MimCmd/src/MimCmd.cpp b/plugins/MimCmd/src/MimCmd.cpp
index 6836069241..fe3c98b56a 100644
--- a/plugins/MimCmd/src/MimCmd.cpp
+++ b/plugins/MimCmd/src/MimCmd.cpp
@@ -81,19 +81,24 @@ int main(int argc, char *argv[])
return MIMRES_NOMIRANDA;
}
- if (argc <= 1 || argc > MAX_ARGUMENTS)
+ if (argc <= 1 || argc > MAX_ARGUMENTS) {
PrintUsage();
+ return 0;
+ }
+
+ int error;
+ PReply reply = ParseCommand(argv, argc);
+ if (reply) {
+ error = reply->code;
+ lpprintf("%s\n", reply->message);
+ }
else {
- PReply reply = ParseCommand(argv, argc);
- if (reply) {
- error = reply->code;
- lpprintf("%s\n", reply->message);
- }
- else lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
-
- DestroyKnownCommands();
- DisconnectFromMiranda();
- DestroyClient();
+ lpprintf(Translate("Unknown command '%s'.\n"), argv[1]);
+ error = 0;
}
- return 0;
+
+ DestroyKnownCommands();
+ DisconnectFromMiranda();
+ DestroyClient();
+ return error;
}