From 6b056e915e0c4c3a2cfe06c2283a3d4cf062b4b0 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 21 Mar 2006 23:12:30 +0000 Subject: [PATCH] Oops, implement the previously-mentioned fix without breaking support for omitting a length argument to mean "the rest of the vector". --- simgear/nasal/lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c index abff3aa3..242b7843 100644 --- a/simgear/nasal/lib.c +++ b/simgear/nasal/lib.c @@ -69,7 +69,8 @@ static naRef subvec(naContext c, naRef me, int argc, naRef* args) len = (int)nlen.num; if(!naIsVector(v) || start < 0 || start >= naVec_size(v) || len < 0) return naNil(); - if(len > naVec_size(v) - start) len = naVec_size(v) - start; + if(naIsNil(nlen) || len > naVec_size(v) - start) + len = naVec_size(v) - start; result = naNewVector(c); naVec_setsize(result, len); for(i=0; i