commit 226ce7505454fe0ddbdbaec50ac038e484da3572
Author: Juergen Spitzmueller <[email protected]>
Date: Tue Dec 20 06:04:29 2022 +0100
Add test
---
src/LaTeXPackages.cpp | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/LaTeXPackages.cpp b/src/LaTeXPackages.cpp
index d2a22a8..bee3055 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<int>(package.second);
+ }
}
return false;
}
--
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs