Index: /trac/trunk/wiki-macros/TracNav.py
===================================================================
--- /trac/trunk/wiki-macros/TracNav.py	(revision 3058)
+++ /trac/trunk/wiki-macros/TracNav.py	(revision 3059)
@@ -183,7 +183,5 @@
     preview = hdf.getValue('args.preview', "")
     curpage = hdf.getValue('wiki.page_name', "")
-    name = args
-    if not name:
-        name = 'TOC'
+    name = args or 'TOC'
 
     toc = parse_toc(get_toc(hdf, env, curpage, name), env)
@@ -242,5 +240,5 @@
     html += '%s<ul>\n' % indentation(col)
     col += 1
-    html += display(env, curpage, toc, 0, col)
+    html += display(curpage, toc, 0, col)
     col -= 1
     html += '%s</ul>\n' % indentation(col)
@@ -249,5 +247,5 @@
     return html
 
-def display(env, curpage, toc, depth, col):
+def display(curpage, toc, depth, col):
     html = ''
     for name, title, sub in toc:
@@ -272,5 +270,5 @@
             html += '%s</li>\n' % indentation(col)
             if len(sub) > 0:
-                html += display(env, curpage, sub, depth + 1, col)
+                html += display(curpage, sub, depth + 1, col)
     return html
 
