Tue Sep 20 07:01:50 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Replace tabs with spaces for nicer output.
Tabs need to be replaced with spaces to avoid problems displaying lines that
begin with tabs.
This patch implements a very simple function to do so, and modifices
print_blob() to use it.
{
hunk ./darcsweb.cgi 142
+def replace_tabs(s):
+ pos = s.find("\t")
+ while pos != -1:
+ count = 8 - (pos % 8)
+ if count:
+ spaces = ' ' * count
+ s = s.replace('\t', spaces, 1)
+ pos = s.find("\t")
+ return s
+
hunk ./darcsweb.cgi 954
+ l = replace_tabs(l)
}