summaryrefslogtreecommitdiffstats
path: root/g10/kbnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/kbnode.c')
-rw-r--r--g10/kbnode.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/g10/kbnode.c b/g10/kbnode.c
index dd4f0ce24..83ec50742 100644
--- a/g10/kbnode.c
+++ b/g10/kbnode.c
@@ -177,11 +177,12 @@ walk_kbnode( KBNODE root, KBNODE *context, int all )
do {
if( !*context ) {
*context = root;
- return root;
+ n = root;
+ }
+ else {
+ n = (*context)->next;
+ *context = n;
}
-
- n = (*context)->next;
- *context = n;
} while( !all && n && (n->private_flag & 1) );
return n;