Fixed bug in single arity version of LAG.
[pspp-builds.git] / src / expressions / parse.c
index ba790d08838a1cb30a3ac550f0926ee0983d5dbd..0abfbb8a50389a161a4449127981a9f687b269de 100644 (file)
@@ -1204,7 +1204,9 @@ parse_function (struct expression *e)
   n = expr_allocate_composite (e, f - operations, args, arg_cnt);
   n->composite.min_valid = min_valid != -1 ? min_valid : f->array_min_elems; 
 
-  if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn) 
+  if (n->type == OP_LAG_Vn || n->type == OP_LAG_Vs)
+      n_lag = 1;
+  else if (n->type == OP_LAG_Vnn || n->type == OP_LAG_Vsn)
     {
       int n_before;
       assert (n->composite.arg_cnt == 2);