data-parser: A hard delimiter at end of line is not an empty field.
[pspp] / src / language / expressions / parse.c
index 3124c100a19e4c8922916fcda501ec2c0db058b1..7b845a8d369ebf6da4b736db7c7028cc1ad9814b 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2006, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2006, 2010, 2011, 2012 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
@@ -39,6 +39,7 @@
 #include "libpspp/pool.h"
 #include "libpspp/str.h"
 
+#include "gl/c-strcase.h"
 #include "gl/xalloc.h"
 \f
 /* Declarations. */
@@ -262,8 +263,9 @@ type_check (struct expression *e,
                atom_type_name (actual_type));
          return false;
        }
-      if (actual_type == OP_number && expected_type == OP_boolean)
-       *n = expr_allocate_unary (e, OP_NUM_TO_BOOLEAN, *n);
+      if (actual_type == OP_number && expected_type == EXPR_BOOLEAN)
+        *n = expr_allocate_binary (e, OP_NUM_TO_BOOLEAN, *n,
+                                   expr_allocate_string (e, ss_empty ()));
       break;
 
     case EXPR_STRING:
@@ -1005,7 +1007,7 @@ compare_names (const char *test, const char *name, bool abbrev_ok)
 static int
 compare_strings (const char *test, const char *name, bool abbrev_ok UNUSED)
 {
-  return strcasecmp (test, name);
+  return c_strcasecmp (test, name);
 }
 
 static bool