Remove "Written by Ben Pfaff <blp@gnu.org>" lines everywhere.
[pspp] / src / language / dictionary / modify-variables.c
index 1e42cb6de0a90caaee4f2d03a28cced19d996965..c74cd529afe2b31f0fab2872365f1b006b2ff568 100644 (file)
@@ -1,6 +1,5 @@
 /* PSPP - computes sample statistics.
    Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
-   Written by Ben Pfaff <blp@gnu.org>.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -354,8 +353,12 @@ compare_variables_given_ordering (const void *a_, const void *b_,
   const struct ordering *ordering = ordering_;
 
   int result;
-  if (ordering->positional)
-    result = a->index < b->index ? -1 : a->index > b->index;
+  if (ordering->positional) 
+    {
+      size_t a_index = var_get_dict_index (a);
+      size_t b_index = var_get_dict_index (b);
+      result = a_index < b_index ? -1 : a_index > b_index; 
+    }
   else
     result = strcasecmp (var_get_name (a), var_get_name (b));
   if (!ordering->forward)