casereader: Fix casereader_select() with BY argument greater than 1.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Sep 2010 04:31:43 +0000 (21:31 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 30 Sep 2010 04:41:58 +0000 (21:41 -0700)
This fixes the /CASES=BY subcommand on LIST.  The following commit will add
a test.

src/data/casereader-select.c

index a26ef67466f0c8c5c58245865ecd50664287866a..d75a605b01349eef258f0fdbe9d04994553e68bc 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 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
@@ -72,7 +72,7 @@ casereader_select (struct casereader *subreader,
     {
       struct casereader_select *cs = xmalloc (sizeof *cs);
       cs->by = by;
-      cs->i = 0;
+      cs->i = by - 1;
       return casereader_create_filter_func (subreader,
                                             casereader_select_include,
                                             casereader_select_destroy,