summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e00c9e1)
raw | patch | inline | side by side (parent: e00c9e1)
author | Kay Sievers <kay.sievers@suse.de> | |
Wed, 31 Aug 2005 01:25:29 +0000 (03:25 +0200) | ||
committer | Kay Sievers <kay.sievers@suse.de> | |
Wed, 31 Aug 2005 01:25:29 +0000 (03:25 +0200) |
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
gitweb.cgi | patch | blob | history |
diff --git a/gitweb.cgi b/gitweb.cgi
index e68368d56bb5f3215b4e6ea0f0aa928324d4886e..6ce9223334b362d291e3f5e187e4cc4cba3a21b2 100755 (executable)
--- a/gitweb.cgi
+++ b/gitweb.cgi
my $rss_link = "";
# absolute fs-path which will be prepended to the project path
-my $projectroot = "/pub/scm";
-$projectroot = "/home/kay/public_html/pub/scm";
+#my $projectroot = "/pub/scm";
+my $projectroot = "/home/kay/public_html/pub/scm";
# location of the git-core binaries
my $gitbin = "/usr/bin";
my $len = shift;
my $add_len = shift || 10;
- $str =~ m/^(.{0,$len}[^ \/\-_:\.@]{0,$add_len})/;
- my $chopped = $1;
- if ($chopped ne $str) {
- $chopped .= " ...";
+ # allow only $len chars, but don't cut a word if it would fit in $add_len
+ # if it doesn't fit, cut it if it's still longer than the dots we would add
+ $str =~ m/^(.{0,$len}[^ \/\-_:\.@]{0,$add_len})(.*)/;
+ my $body = $1;
+ my $tail = $2;
+ if (length($tail) > 4) {
+ $tail = " ...";
}
- return $chopped;
+ return "$body$tail";
}
sub file_type {