summaryrefslogtreecommitdiff
path: root/libguile/stacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/stacks.c')
-rw-r--r--libguile/stacks.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libguile/stacks.c b/libguile/stacks.c
index 86188f416..d0e82f7bd 100644
--- a/libguile/stacks.c
+++ b/libguile/stacks.c
@@ -184,11 +184,10 @@ narrow_stack (SCM stack, long inner, SCM inner_key, long outer, SCM outer_key)
else
{
/* Cut specified number of frames. */
- for (; outer && len ; --outer)
- {
- frame = scm_stack_ref (stack, scm_from_long (len - 1));
- len--;
- }
+ if (outer < len)
+ len -= outer;
+ else
+ len = 0;
}
SCM_SET_STACK_LENGTH (stack, len);