Fix TLogger.AddStdLine to work with Wine 1.6
[mgsmtp.git] / Log.pas
diff --git a/Log.pas b/Log.pas
index 98001213fde6ed53527bc56414f5d05a01ac29c3..46538b234fd0fb3bda1adf915d78c2d81dd7c43b 100644 (file)
--- a/Log.pas
+++ b/Log.pas
@@ -1,6 +1,6 @@
 {
    MegaBrutal's SMTP Server (MgSMTP)
-   Copyright (C) 2010-2014 MegaBrutal
+   Copyright (C) 2010-2018 MegaBrutal
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
@@ -146,14 +146,20 @@ end;
 
 function TLogger.AddStdLine(Line: string): boolean;
 { Log message to both stdout and smtp.log. }
+var outresult, logresult: boolean;
 begin
-   Result:= Out.AddLine(Line) and AddLine(Line);
+   outresult:= Out.AddLine(Line);
+   logresult:= AddLine(Line);
+   Result:= outresult and logresult;
 end;
 
 function TLogger.AddStdLine(Agent, Line: string): boolean;
 { Log message to both stdout and smtp.log. }
+var outresult, logresult: boolean;
 begin
-   Result:= Out.AddLine(Agent, Line) and AddLine(Agent, Line);
+   outresult:= Out.AddLine(Agent, Line);
+   logresult:= AddLine(Agent, Line);
+   Result:= outresult and logresult;
 end;