FREQUENCIES: Fix bug when combining HISTOGRAM with PERCENTILES.
[pspp] / src / language / stats / frequencies.c
index 2e6a3430f75138473405cd1a141a8cec9aade0f2..17e03130923bab5888580f0493d39f8decd712e3 100644 (file)
@@ -82,6 +82,14 @@ ptile_3way (const void *_p1, const void *_p2)
   if (p1->p < p2->p)
     return -1;
 
+  if (p1->p == p2->p)
+    {
+      if (p1->show > p2->show)
+       return -1;
+
+      return (p1->show < p2->show);
+    }
+
   return (p1->p > p2->p);
 }
 
@@ -766,6 +774,7 @@ cmd_frequencies (struct lexer *lexer, struct dataset *ds)
                  lex_error (lexer, NULL);
                  goto error;
                }
+              lex_match (lexer, T_COMMA);
            }
        }
       else if (lex_match_id (lexer, "FORMAT"))