]> git.lyx.org Git - features.git/commitdiff
Fix substitution for $$Contents.
authorRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 04:15:48 +0000 (00:15 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 04:15:48 +0000 (00:15 -0400)
The second argument here is the length of the string to replace,
not the position of the final character.

src/insets/ExternalSupport.cpp

index f208a953d3b441b6554f98dc3fb3f4364450e26d..37c382a37f64cf6b8a4636c95f3b946a9024a7a7 100644 (file)
@@ -200,7 +200,7 @@ string const doSubstitution(InsetExternalParams const & params,
 
                size_t const pos = result.find("$$Contents(\"");
                size_t const end = result.find("\")", pos);
-               result.replace(pos, end + 2, contents);
+               result.replace(pos, end + 2- pos, contents);
        }
 
        return result;