From ef57a28b5f42204d3e0b1e54c79d188f476eed23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 27 Sep 2023 12:24:45 +0200
Subject: [PATCH] =?UTF-8?q?Use=20same=20default=20variable=20cleaning=20ru?=
 =?UTF-8?q?le=20under=20Octave=20as=20under=20MATLAB=20=E2=A9=BE=208.6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

“clearvars” has been implemented in Octave since version 5.
---
 src/ModFile.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ModFile.cc b/src/ModFile.cc
index 23f86c7a..ae13c4ba 100644
--- a/src/ModFile.cc
+++ b/src/ModFile.cc
@@ -823,7 +823,7 @@ ModFile::writeMOutput(const string &basename, bool clear_all, bool clear_global,
     mOutputFile << "warning off" << endl; // This will be executed *after* function warning_config()
 
   if (clear_all)
-    mOutputFile << "if isoctave || matlab_ver_less_than('8.6')" << endl
+    mOutputFile << "if ~isoctave && matlab_ver_less_than('8.6')" << endl
                 << "    clear all" << endl
                 << "else" << endl
                 << "    clearvars -global" << endl
-- 
GitLab