]> git.lyx.org Git - features.git/commitdiff
Add test
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 Dec 2022 05:04:29 +0000 (06:04 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 20 Dec 2022 05:04:29 +0000 (06:04 +0100)
src/LaTeXPackages.cpp

index d2a22a8879b6fc3883e4a9c55a2bafb934f70b03..bee30558d372b3366bfc9f6fd99554b9c340ad1e 100644 (file)
@@ -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;
 }