From c03c537a8a411adf66a368dfbb5a43fc874e6167 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 5 Jan 2008 16:51:06 +0000 Subject: [PATCH] Minor modification: do not worry about .sty extension. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22386 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LaTeXFeatures.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 6718a2ff8e..be4d36a258 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -406,9 +406,13 @@ bool LaTeXFeatures::mustProvide(string const & name) const bool LaTeXFeatures::isAvailable(string const & name) { + string n = name; if (packages_.empty()) getAvailable(); - return find(packages_.begin(), packages_.end(), name) != packages_.end(); + size_t loc = n.rfind(".sty"); + if (loc == n.length() - 4) + n = n.erase(name.length() - 4); + return find(packages_.begin(), packages_.end(), n) != packages_.end(); }