]> git.sesse.net Git - pgn-extract/blobdiff - lex.c
Store start position in the binary output.
[pgn-extract] / lex.c
diff --git a/lex.c b/lex.c
index 2b1b60fea25bc850c00d88b9355173be0b678a10..0c8d26f192148e54c1ea5ac32f54587dc29dbfbc 100644 (file)
--- a/lex.c
+++ b/lex.c
@@ -332,7 +332,7 @@ gather_string(char *line, unsigned char *linep)
         if(!GlobalState.skipping_current_game) {
             fprintf(GlobalState.logfile,"Missing closing quote in %s\n",line);
        }
-        if(len != 1){
+        if(len > 1){
             /* Move back to the null. */
             linep--;
             str[len-1] = '\0';
@@ -1268,3 +1268,8 @@ terminate_input(void)
     }
 }
 
+    /* Return the position in the current file. Returns -1 if it is unseekable. */
+long get_position(void)
+{
+    return ftell(yyin);
+}