From 72023030d9908038295822adadfc29551917354e Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Sun, 13 May 2012 18:41:51 +0200 Subject: [PATCH] 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(). --- src/tex2lyx/Preamble.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index d1fd96366a..b3202ace13 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1269,8 +1269,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() << "}"; -- 2.39.5