]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlex.C
redraw fix 1.
[lyx.git] / src / lyxlex.C
index 118162bdc1b43c3e70f8f4a548f2f25080635d8c..04c4b23c7eb6fe7661ce6c6f5e1888106eafa539 100644 (file)
@@ -236,21 +236,22 @@ void LyXLex::pushToken(string const & pt)
 
 int LyXLex::findToken(char const * str[])
 {
+       if (!next()) {
+               pimpl_->printError("file ended while scanning string token");
+               return -1;
+       }
        int i = 0;
-
-       if (next()) {
-               if (compare(pimpl_->buff, "default")) {
-                       while (str[i][0] && compare(str[i], pimpl_->buff)) {
-                               ++i;
-                       }
-                       if (!str[i][0]) {
-                               pimpl_->printError("Unknown argument `$$Token'");
-                               i = -1;
-                       }
+   
+       if (compare(pimpl_->buff, "default")) {
+               while (str[i][0] && compare(str[i], pimpl_->buff)) {
+                       ++i;
+               }
+               if (!str[i][0]) {
+                       pimpl_->printError("Unknown argument `$$Token'");
+                       i = -1;
                }
-       } else {
-               pimpl_->printError("file ended while scanning string token");
-               i = -1;
        }
        return i;
 }