message: Add column range to struct msg_locator.
[pspp] / src / data / data-in.c
index c105454ae6654ffda20a4e5bbe4ae5a3eadfa28a..35a725d577d08ff50711c37b10fb8b2f021bb202 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2006, 2009 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2006, 2009, 2010 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
@@ -873,7 +873,7 @@ parse_trailer (struct data_in *i)
   if (ss_is_empty (i->input))
     return true;
 
-  data_warning (i, _("Trailing garbage \"%.*s\" following date."),
+  data_warning (i, _("Trailing garbage `%.*s' following date."),
               (int) ss_length (i->input), ss_data (i->input));
   return false;
 }
@@ -1187,15 +1187,6 @@ vdata_warning (const struct data_in *i, const char *format, va_list args)
 
   ds_init_empty (&text);
   ds_put_char (&text, '(');
-  if (i->first_column != 0)
-    {
-      if (i->first_column == i->last_column - 1)
-        ds_put_format (&text, _("column %d"), i->first_column);
-      else
-        ds_put_format (&text, _("columns %d-%d"),
-                       i->first_column, i->last_column - 1);
-      ds_put_cstr (&text, ", ");
-    }
   ds_put_format (&text, _("%s field) "), fmt_name (i->format));
   ds_put_vformat (&text, format, args);
 
@@ -1203,7 +1194,9 @@ vdata_warning (const struct data_in *i, const char *format, va_list args)
   m.severity = MSG_S_WARNING;
   m.text = ds_cstr (&text);
   m.where.file_name = NULL;
-  m.where.line_number = -1;
+  m.where.line_number = 0;
+  m.where.first_column = i->first_column;
+  m.where.last_column = i->last_column;
 
   msg_emit (&m);
 }