shithub: riscv

Download patch

ref: f57e4ecb015db6b1f7f4e1db1efa76dc9b1fadcc
parent: b62042cdebfe221eb78245ee756d0f0dfde9cc9d
author: cinap_lenrek <[email protected]>
date: Mon Sep 10 18:20:40 EDT 2012

hgwebfs: remove prefixing // from file path

--- a/sys/lib/python/hgext/hgwebfs.py
+++ b/sys/lib/python/hgext/hgwebfs.py
@@ -10,8 +10,11 @@
 		else:
 			self.url = req.get_full_url()
 		if self.url[0:5] == 'file:':
+			path = self.url[5:]
+			while path[0:2] == '//':
+				path = path[1:]
 			self.dir = '/dev/null'
-			self.body = open(self.url[5:], 'r', 0)
+			self.body = open(path, 'r', 0)
 			return
 		ctl = open(mnt+'/clone', 'r+', 0)
 		try: