patch: http.py

Robey Pointer robey at lag.net
Mon Oct 17 18:24:38 BST 2005


Quickie fix to something I saw while browsing http.py:  The length of  
a list will never be less than zero (in python, at least...) so I  
think the intended check was for "== 0".

robey


=== modified file 'bzrlib/transport/http.py'
--- bzrlib/transport/http.py
+++ bzrlib/transport/http.py
@@ -85,12 +85,11 @@
          for p in relpath:
              if p == '..':
-                if len(basepath) < 0:
+                if len(basepath) == 0:
                      # In most filesystems, a request for the parent
                      # of root, just returns root.
                      continue
-                if len(basepath) > 0:
-                    basepath.pop()
+                basepath.pop()
              elif p == '.':
                  continue # No-op
              else:






More information about the bazaar mailing list