From: andy Date: Tue, 21 Mar 2006 23:12:30 +0000 (+0000) Subject: Oops, implement the previously-mentioned fix without breaking support X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b056e915e0c4c3a2cfe06c2283a3d4cf062b4b0;p=simgear.git Oops, implement the previously-mentioned fix without breaking support for omitting a length argument to mean "the rest of the vector". --- 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