]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetbibtex.C
hopefully fix tex2lyx linking.
[lyx.git] / src / insets / insetbibtex.C
index c0fe99bcdee483295d792483f493a8d019bc3c76..d0f8ff7d6690a88aff86e0ae4110a380223ffe65 100644 (file)
@@ -44,7 +44,7 @@ using support::ascii_lowercase;
 using support::changeExtension;
 using support::contains;
 using support::copy;
-using support::FileName;
+using support::DocFileName;
 using support::findtexfile;
 using support::isFileReadable;
 using support::latex_path;
@@ -155,6 +155,9 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
        typedef boost::tokenizer<Separator, docstring::const_iterator, docstring> Tokenizer;
 
        Separator const separator(from_ascii(",").c_str());
+       // The tokenizer must not be called with temporary strings, since
+       // it does not make a copy and uses iterators of the string further
+       // down. getParam returns a reference, so this is OK.
        Tokenizer const tokens(getParam("bibfiles"), separator);
        Tokenizer::const_iterator const begin = tokens.begin();
        Tokenizer::const_iterator const end = tokens.end();
@@ -172,7 +175,7 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
                    isFileReadable(in_file)) {
 
                        // mangledFilename() needs the extension
-                       database = removeExtension(FileName(in_file).mangledFilename());
+                       database = removeExtension(DocFileName(in_file).mangledFilename());
                        string const out_file = makeAbsPath(database + ".bib",
                                        buffer.getMasterBuffer()->temppath());
 
@@ -228,7 +231,7 @@ int InsetBibtex::latex(Buffer const & buffer, odocstream & os,
                    isFileReadable(in_file)) {
                        // use new style name
                        base = removeExtension(
-                                       FileName(in_file).mangledFilename());
+                                       DocFileName(in_file).mangledFilename());
                        string const out_file = makeAbsPath(base + ".bst",
                                        buffer.getMasterBuffer()->temppath());
                        bool const success = copy(in_file, out_file);