projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Patch by Matt McCutchen to find levels in current directory when selected from comman...
[supertux.git]
/
src
/
lisp
/
lexer.cpp
diff --git
a/src/lisp/lexer.cpp
b/src/lisp/lexer.cpp
index
451cb9a
..
90f4aa2
100644
(file)
--- a/
src/lisp/lexer.cpp
+++ b/
src/lisp/lexer.cpp
@@
-22,6
+22,7
@@
#include <cstring>
#include <stdexcept>
#include <iostream>
#include <cstring>
#include <stdexcept>
#include <iostream>
+#include <stdio.h>
#include "lexer.hpp"
#include "lexer.hpp"
@@
-102,8
+103,8
@@
Lexer::getNextToken()
return TOKEN_CLOSE_PAREN;
case '"': { // string
int startline = linenumber;
return TOKEN_CLOSE_PAREN;
case '"': { // string
int startline = linenumber;
- nextChar();
while(1) {
while(1) {
+ nextChar();
switch(c) {
case '"':
nextChar();
switch(c) {
case '"':
nextChar();
@@
-132,7
+133,8
@@
Lexer::getNextToken()
default:
break;
}
default:
break;
}
- addChar();
+ if(token_length < MAX_TOKEN_LENGTH)
+ token_string[token_length++] = c;
}
string_finished:
token_string[token_length] = 0;
}
string_finished:
token_string[token_length] = 0;