From 9d6c0dc580d39ccf0f55416af0a3974a85195405 Mon Sep 17 00:00:00 2001
From: andy <andy>
Date: Tue, 21 Mar 2006 22:22:47 +0000
Subject: [PATCH] The original code (rather oddly) interprets a length of zero
 in subvec() to mean "the whole vector".  Melchior showed a use case (removal
 of the first element from a vector) where getting a zero-length subvector is
 actually desired.  And since I can't come up with a good reason for why the
 "feature" was there in the first place, out it goes...

---
 simgear/nasal/lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c
index 7984e3dd..abff3aa3 100644
--- a/simgear/nasal/lib.c
+++ b/simgear/nasal/lib.c
@@ -69,7 +69,7 @@ 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 == 0 || len > naVec_size(v) - start) len = naVec_size(v) - start;
+    if(len > naVec_size(v) - start) len = naVec_size(v) - start;
     result = naNewVector(c);
     naVec_setsize(result, len);
     for(i=0; i<len; i++)
-- 
2.39.5