The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 3ded1c8506bbadceea4b5da5bd553a788a1dce93
Author: Georg Baum <[email protected]>
Date:   Sun May 13 18:41:51 2012 +0200

    Fix bug #8116.
    
    The string we parse as name may contain backslashes if \csname ... 
\endcsname
    is used. Therefore we have to output it using asInput() instead of cs().

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 454f216..6b4b404 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -1262,8 +1262,12 @@ void Preamble::parse(Parser & p, string const & 
forceclass,
 
                else if (t.cs() == "def") {
                        string name = p.get_token().cs();
+                       // In fact, name may be more than the name:
+                       // In the test case of bug 8116
+                       // name == "csname SF@gobble@opt \endcsname".
+                       // Therefore, we need to use asInput() instead of cs().
                        while (p.next_token().cat() != catBegin)
-                               name += p.get_token().cs();
+                               name += p.get_token().asInput();
                        if (!in_lyx_preamble)
                                h_preamble << "\\def\\" << name << '{'
                                           << p.verbatim_item() << "}";

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/Preamble.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to