From 226ce7505454fe0ddbdbaec50ac038e484da3572 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 20 Dec 2022 06:04:29 +0100 Subject: [PATCH] Add test --- src/LaTeXPackages.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/LaTeXPackages.cpp b/src/LaTeXPackages.cpp index d2a22a8879..bee30558d3 100644 --- a/src/LaTeXPackages.cpp +++ b/src/LaTeXPackages.cpp @@ -19,6 +19,7 @@ #include "Lexer.h" #include "support/convert.h" +#include "support/debug.h" #include "support/FileName.h" #include "support/filetools.h" #include "support/lstrings.h" @@ -92,9 +93,15 @@ bool LaTeXPackages::isAvailableAtLeastFrom(string const & name, // required date as int (yyyymmdd) int const req_date = (y * 10000) + (m * 100) + d; for (auto const & package : packages_) { - if (package.first == name && !package.second.empty()) + if (package.first == name && !package.second.empty()) { + if (!isStrInt(package.second)) { + LYXERR0("Warning: Invalid date of package " + << package.first << " (" << package.second << ")"); + continue; + } // required date not newer than available date return req_date <= convert(package.second); + } } return false; } -- 2.39.5