diff liboctave/Array.cc @ 5379:27986bd3e238

[project @ 2005-06-02 18:21:20 by jwe]
author jwe
date Thu, 02 Jun 2005 18:21:20 +0000
parents 15843d76156d
children b957f4222249
line wrap: on
line diff
--- a/liboctave/Array.cc
+++ b/liboctave/Array.cc
@@ -3027,14 +3027,24 @@
 		  if (k < rhs_dims.length ())
 		    new_dims(i) = rhs_dims(k++);
 		  else
+		    new_dims(i) = 1;
+		}
+	      else
+		{
+		  octave_idx_type nelem = idx(i).capacity ();
+
+		  if (nelem >= 1
+		      && k < rhs_dims.length () && nelem == rhs_dims(k))
+		    k++;
+		  else if (nelem != 1)
 		    {
 		      (*current_liboctave_error_handler)
-			("A(IDX-LIST) = RHS: A previously undefined and more colons in IDX-LIST than dimensions for RHS");
+			("A(IDX-LIST) = RHS: mismatched index and RHS dimension");
 		      return retval;
 		    }
+
+		  new_dims(i) = idx(i).max () + 1;
 		}
-	      else
-		new_dims(i) = idx(i).max () + 1;
 	    }
 	}
       else