From dfba1c409a4c698f17456783ec0a141a9b3d41de Mon Sep 17 00:00:00 2001
From: John Darrington <john@darrington.wattle.id.au>
Date: Wed, 24 Apr 2013 20:30:48 +0200
Subject: [PATCH] Fixed crash with EXAMINE vs. SPLIT

Partial fix for bug #38820
---
 src/language/stats/examine.c            | 6 ++----
 tests/language/dictionary/split-file.at | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/language/stats/examine.c b/src/language/stats/examine.c
index e4acc6c9da..ea1b5dba19 100644
--- a/src/language/stats/examine.c
+++ b/src/language/stats/examine.c
@@ -1527,7 +1527,7 @@ update_n (const void *aux1, void *aux2 UNUSED, void *user_data,
   int v;
   const struct examine *examine = aux1;
   struct exploratory_stats *es = user_data;
-
+  
   for (v = 0; v < examine->n_dep_vars; v++)
     {
       struct ccase *outcase ;
@@ -1801,12 +1801,10 @@ run_examine (struct examine *cmd, struct casereader *input)
 
   categoricals_set_payload (cmd->cats, &payload, cmd, NULL);
 
-  if (cmd->id_idx == -1)
+  if (cmd->id_var == NULL)
     {
       struct ccase *c = casereader_peek (input,  0);
 
-      assert (cmd->id_var == NULL);
-
       cmd->id_idx = case_get_value_cnt (c);
       input = casereader_create_arithmetic_sequence (input, 1.0, 1.0);
 
diff --git a/tests/language/dictionary/split-file.at b/tests/language/dictionary/split-file.at
index 710907ccec..4ffd71e5a5 100644
--- a/tests/language/dictionary/split-file.at
+++ b/tests/language/dictionary/split-file.at
@@ -85,7 +85,7 @@ CROSSTABS a by b.
 CORRELATIONS /VARIABLES = a b.
 DELETE VARIABLES a.
 DESCRIPTIVES e .
-* EXAMINE c by b.
+EXAMINE c by b.
 EXPORT outfile='xxx'.
 FACTOR /VARIABLES = b c d.
 FILTER BY c.
-- 
2.30.2