Count Dialog and Recode Dialog: Make syntax generation locale independent
[pspp] / src / output / measure.c
index 2064f45b13e2d69935fc5ea443aaa288b4cec52c..60894f1cc25f81b3b21ae862ee646e0ac1d3c0ac 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2007, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2007, 2009, 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
 
 #include <config.h>
 
-#include <output/measure.h>
+#include "output/measure.h"
 
+#include <gl/c-strtod.h>
 #include <ctype.h>
 #include <errno.h>
 #if HAVE_LC_PAPER
 #include <langinfo.h>
 #endif
-#include <libpspp/str.h>
 #include <stdlib.h>
 
-#include <data/file-name.h>
+#include "data/file-name.h"
+#include "libpspp/str.h"
 
 #include "gl/error.h"
 
@@ -50,7 +51,7 @@ measure_dimension (const char *dimen)
   char *tail;
 
   /* Number. */
-  raw = strtod (dimen, &tail);
+  raw = c_strtod (dimen, &tail);
   if (raw < 0.0)
     goto syntax_error;
 
@@ -150,7 +151,7 @@ parse_paper_size (const char *size, int *h, int *v)
   char *tail;
 
   /* Width. */
-  raw_h = strtod (size, &tail);
+  raw_h = c_strtod (size, &tail);
   if (raw_h <= 0.0)
     return false;
 
@@ -158,7 +159,7 @@ parse_paper_size (const char *size, int *h, int *v)
   tail += strspn (tail, CC_SPACES "x,");
 
   /* Length. */
-  raw_v = strtod (tail, &tail);
+  raw_v = c_strtod (tail, &tail);
   if (raw_v <= 0.0)
     return false;
 
@@ -245,7 +246,7 @@ read_paper_conf (const char *file_name, int *h, int *v)
   file = fopen (file_name, "r");
   if (file == NULL)
     {
-      error (0, errno, _("error opening input file \"%s\""), file_name);
+      error (0, errno, _("error opening input file `%s'"), file_name);
       return false;
     }
 
@@ -256,7 +257,7 @@ read_paper_conf (const char *file_name, int *h, int *v)
       if (!ds_read_config_line (&line, &line_number, file))
        {
          if (ferror (file))
-           error (0, errno, _("error reading file \"%s\""), file_name);
+           error (0, errno, _("error reading file `%s'"), file_name);
          break;
        }
 
@@ -273,7 +274,7 @@ read_paper_conf (const char *file_name, int *h, int *v)
 
   fclose (file);
   ds_destroy (&line);
-  error (0, 0, _("paper size file \"%s\" does not state a paper size"),
+  error (0, 0, _("paper size file `%s' does not state a paper size"),
          file_name);
   return false;
 }