fix string lexer
[pspp] / tests / language / lexer / scan-test.c
index abbf0f9455196331dc617dc47abd0ddee6926bef..2a77e127ace3405ce6770b31aaf0cd7544d3db9d 100644 (file)
@@ -61,8 +61,8 @@ main (int argc, char *argv[])
 
   /* Read from stdin into 'input'. */
   input = (!strcmp (file_name, "-")
-           ? fread_file (stdin, &length)
-           : read_file (file_name, &length));
+           ? fread_file (stdin, 0, &length)
+           : read_file (file_name, 0, &length));
   if (input == NULL)
     error (EXIT_FAILURE, errno, "reading %s failed", file_name);
 
@@ -73,7 +73,7 @@ main (int argc, char *argv[])
         length--;
     }
 
-  string_lexer_init (&slex, input, length, mode);
+  string_lexer_init (&slex, input, length, mode, false);
   do
     {
       struct token token;
@@ -94,7 +94,7 @@ main (int argc, char *argv[])
         printf (" \"%.*s\"", (int) token.string.length, token.string.string);
       printf ("\n");
 
-      token_destroy (&token);
+      token_uninit (&token);
     }
   while (more);