[poppler] poppler/poppler: Lexer.cc,1.4,1.5 Lexer.h,1.4,1.5
Albert Astals Cid
aacid at kemper.freedesktop.org
Sat Feb 3 16:16:45 PST 2007
Update of /cvs/poppler/poppler/poppler
In directory kemper:/tmp/cvs-serv17150/poppler
Modified Files:
Lexer.cc Lexer.h
Log Message:
* poppler/Lexer.cc:
* poppler/Lexer.h: Patch to fix regression introduced by optimizations
in bugzilla issue 7808
Index: Lexer.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Lexer.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Lexer.cc 28 Dec 2006 15:51:44 -0000 1.4
+++ Lexer.cc 4 Feb 2007 00:16:43 -0000 1.5
@@ -92,7 +92,7 @@
}
}
-int inline Lexer::getChar() {
+int Lexer::getChar(GBool comesFromLook) {
int c;
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
@@ -103,23 +103,33 @@
c = EOF;
while (!curStr.isNone() && (c = curStr.streamGetChar()) == EOF) {
- curStr.streamClose();
- curStr.free();
- ++strPtr;
- if (strPtr < streams->getLength()) {
- streams->get(strPtr, &curStr);
- curStr.streamReset();
+ if (comesFromLook == gTrue) {
+ return EOF;
+ } else {
+ curStr.streamClose();
+ curStr.free();
+ ++strPtr;
+ if (strPtr < streams->getLength()) {
+ streams->get(strPtr, &curStr);
+ curStr.streamReset();
+ }
}
}
return c;
}
-int inline Lexer::lookChar() {
+int Lexer::lookChar() {
+
if (LOOK_VALUE_NOT_CACHED != lookCharLastValueCached) {
return lookCharLastValueCached;
}
- lookCharLastValueCached = getChar();
- return lookCharLastValueCached;
+ lookCharLastValueCached = getChar(gTrue);
+ if (lookCharLastValueCached == EOF) {
+ lookCharLastValueCached = LOOK_VALUE_NOT_CACHED;
+ return EOF;
+ } else {
+ return lookCharLastValueCached;
+ }
}
Object *Lexer::getObj(Object *obj, int objNum) {
Index: Lexer.h
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Lexer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Lexer.h 28 Dec 2006 15:51:44 -0000 1.4
+++ Lexer.h 4 Feb 2007 00:16:43 -0000 1.5
@@ -75,7 +75,7 @@
private:
- int getChar();
+ int getChar(GBool comesFromLook = gFalse);
int lookChar();
Array *streams; // array of input streams
More information about the poppler
mailing list