The branch, master, has been updated.

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

commit 2a13b02a94fdcbb6a4a700801a5ea10e737f4655
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Mon Jun 25 11:04:56 2012 +0200

    Fix bug #8220: tex2lyx crashes on single-character commands
    
    Fix commit [aa9fed93/lyxgit]: it is never a good idea to call substr(4) on 
a string without checking its length. Moreover, it is even better in this case 
to check that the first letters are "text" as the reminder of the code 
assumes...

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 50eee93..c28e436 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -3573,7 +3573,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                                              context.font.language, lang);
                }
                
-               else if (is_known(t.cs().substr(4, string::npos), 
polyglossia_languages)) {
+               else if (prefixIs(t.cs(), "text") 
+                        && is_known(t.cs().substr(4), polyglossia_languages)) {
                        // scheme is \textLANGUAGE{text} where LANGUAGE is in 
polyglossia_languages[]
                        string lang;
                        // We have to output the whole command if it has an 
option

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

Summary of changes:
 src/tex2lyx/text.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to