Index: /trac/trunk/wiki-macros/TracNav.py
===================================================================
--- /trac/trunk/wiki-macros/TracNav.py	(revision 3057)
+++ /trac/trunk/wiki-macros/TracNav.py	(revision 3058)
@@ -45,5 +45,7 @@
 == Author and license ==
 
-Copyright 2005 Bernhard Haumacher (haui at haumacher.de)
+Copyright 2005
+ *  Bernhard Haumacher (haui at haumacher.de)
+ *  Thomas Moschny (moschny at ipd.uni-karlsruhe.de)
 
 {{{
@@ -141,18 +143,12 @@
     indentation of the first entry.
     """
-    try:
-        indent, link, label = gen.next()
-    except StopIteration:
-        indent = -1
-    yield indent
-
-    ready = False
-    while not ready:
-        yield link, label
+    while True:
         try:
             indent, link, label = gen.next()
         except StopIteration:
-            indent, ready = -1, True
+            yield -1
+            return
         yield indent
+        yield link, label        
 
 
