upgraded to xpdf-3.01pl1
[swftools.git] / pdf2swf / xpdf / Lexer.cc
index d037469..9f0c3ca 100644 (file)
@@ -2,15 +2,16 @@
 //
 // Lexer.cc
 //
-// Copyright 1996-2002 Glyph & Cog, LLC
+// Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
 
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
 #pragma implementation
 #endif
 
-#include <aconf.h>
 #include <stdlib.h>
 #include <stddef.h>
 #include <string.h>
@@ -170,6 +171,13 @@ Object *Lexer::getObj(Object *obj) {
     scale = 0.1;
     while (1) {
       c = lookChar();
+      if (c == '-') {
+       // ignore minus signs in the middle of numbers to match
+       // Adobe's behavior
+       error(getPos(), "Badly formatted number");
+       getChar();
+       continue;
+      }
       if (!isdigit(c)) {
        break;
       }
@@ -471,3 +479,7 @@ void Lexer::skipToNextLine() {
     }
   }
 }
+
+GBool Lexer::isSpace(int c) {
+  return c >= 0 && c <= 0xff && specialChars[c] == 1;
+}