]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlex_pimpl.C
Fix natbib bug spotted by JMarc.
[lyx.git] / src / lyxlex_pimpl.C
index 3156c864da197cfffcf1ccd40fb8dfcf0fad0fff..4bca54ed3101a1d0960b63a6eefd03576333f7f8 100644 (file)
@@ -172,7 +172,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
 #if 1
                                is.getline(buff, sizeof(buff));
                                lyxerr[Debug::LYXLEX] << "Comment read: `" << c
-                                                     << buff << "'" << endl;
+                                                     << buff << '\'' << endl;
 #else
                                // unfortunately ignore is buggy (Lgb)
                                is.ignore(100, '\n');
@@ -288,7 +288,7 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
 #if 1
                                is.getline(buff, sizeof(buff));
                                lyxerr[Debug::LYXLEX] << "Comment read: `" << c
-                                                     << buff << "'" << endl;
+                                                     << buff << '\'' << endl;
 #else
                                // but ignore is also still buggy (Lgb)
                                // This is fast (Lgb)
@@ -352,8 +352,8 @@ bool LyXLex::Pimpl::next(bool esc /* = false */)
                                        is.get(cc);
                                        c = cc;
                                } while (c > ' ' && c != ',' && is
-                                        && (i != LEX_MAX_BUFF-1));
-                               if (i == LEX_MAX_BUFF-1) {
+                                        && (i != LEX_MAX_BUFF - 1));
+                               if (i == LEX_MAX_BUFF - 1) {
                                        printError("Line too long");
                                }
                                buff[i] = '\0';
@@ -379,8 +379,11 @@ int LyXLex::Pimpl::search_kw(char const * const tag) const
        keyword_item * res =
                lower_bound(table, table + no_items,
                            search_tag, compare_tags());
+       // use the compare_ascii_no_case instead of compare_no_case,
+       // because in turkish, 'i' is not the lowercase version of 'I',
+       // and thus turkish locale breaks parsing of tags.
        if (res != table + no_items
-           && !compare_no_case(res->tag, tag))
+           && !compare_ascii_no_case(res->tag, tag))
                return res->code;
        return LEX_UNDEF;
 }
@@ -405,7 +408,7 @@ bool LyXLex::Pimpl::eatLine()
                is.get(cc);
                c = cc;
                //lyxerr[Debug::LYXLEX] << "LyXLex::EatLine read char: `"
-               //                    << c << "'" << endl;
+               //                    << c << '\'' << endl;
                if (c != '\r')
                        buff[i++] = c;
        }
@@ -461,14 +464,14 @@ bool LyXLex::Pimpl::nextToken()
                                        is.get(cc);
                                        c = cc;
                                } while (c > ' ' && c != '\\' && is
-                                        && i != (LEX_MAX_BUFF-1));
+                                        && i != (LEX_MAX_BUFF - 1));
                        } else {
                                do {
                                        buff[i++] = c;
                                        is.get(cc);
                                        c = cc;
                                } while (c >= ' ' && c != '\\' && is
-                                        && i != (LEX_MAX_BUFF-1));
+                                        && i != (LEX_MAX_BUFF - 1));
                        }
 
                        if (i == (LEX_MAX_BUFF - 1)) {