aboutsummaryrefslogtreecommitdiff
path: root/control
diff options
context:
space:
mode:
Diffstat (limited to 'control')
-rw-r--r--control/getdir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/control/getdir.c b/control/getdir.c
index 5a13a48..2c621e3 100644
--- a/control/getdir.c
+++ b/control/getdir.c
@@ -27,10 +27,11 @@ static void getdir_bang(t_getdir *x)
{
int i = x->x_level;
t_canvas* last = x->x_canvas;
- do {
+
+ while (i>0) {
i--;
- last = last->gl_owner;
- } while (last && i);
+ if (last->gl_owner) last = last->gl_owner;
+ }
outlet_symbol(x->x_outlet,canvas_getdir(last));
}