str: Rename ss_chomp() to ss_chomp_byte(), ds_chomp() to ds_chomp_byte().
[pspp-builds.git] / src / language / data-io / data-reader.c
index 142e1d4a2fe92b9c9ff8e121c031726549ab1efc..87fa8c92efa7f8da06814633f7bd1f017a7e13f2 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-2004, 2006, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-2004, 2006, 2010, 2011 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
 
 #include <config.h>
 
-#include <language/data-io/data-reader.h>
+#include "language/data-io/data-reader.h"
 
 #include <ctype.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 
-#include <data/casereader.h>
-#include <data/file-handle-def.h>
-#include <data/file-name.h>
-#include <data/procedure.h>
-#include <language/command.h>
-#include <language/data-io/file-handle.h>
-#include <language/lexer/lexer.h>
-#include <language/prompt.h>
-#include <libpspp/assertion.h>
-#include <libpspp/cast.h>
-#include <libpspp/integer-format.h>
-#include <libpspp/message.h>
-#include <libpspp/str.h>
-
-#include "minmax.h"
-#include "xalloc.h"
+#include "data/casereader.h"
+#include "data/file-handle-def.h"
+#include "data/file-name.h"
+#include "data/procedure.h"
+#include "language/command.h"
+#include "language/data-io/file-handle.h"
+#include "language/lexer/lexer.h"
+#include "language/prompt.h"
+#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
+#include "libpspp/integer-format.h"
+#include "libpspp/message.h"
+#include "libpspp/str.h"
+
+#include "gl/minmax.h"
+#include "gl/xalloc.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -178,7 +178,7 @@ read_inline_record (struct dfm_reader *r)
     {
       r->flags |= DFM_SAW_BEGIN_DATA;
 
-      while (lex_token (r->lexer) == '.')
+      while (lex_token (r->lexer) == T_ENDCMD)
         lex_get (r->lexer);
       if (!lex_force_match_id (r->lexer, "BEGIN") || !lex_force_match_id (r->lexer, "DATA"))
         return false;
@@ -343,7 +343,7 @@ read_file_record (struct dfm_reader *r)
     case FH_MODE_TEXT:
       if (ds_read_line (&r->line, r->file, SIZE_MAX))
         {
-          ds_chomp (&r->line, '\n');
+          ds_chomp_byte (&r->line, '\n');
           return true;
         }
       else
@@ -352,7 +352,6 @@ read_file_record (struct dfm_reader *r)
             read_error (r);
           return false;
         }
-      return true;
 
     case FH_MODE_FIXED:
       if (ds_read_stream (&r->line, 1, fh_get_record_width (r->fh), r->file))
@@ -365,7 +364,6 @@ read_file_record (struct dfm_reader *r)
             partial_record (r);
           return false;
         }
-      return true;
 
     case FH_MODE_VARIABLE:
       {