Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike@mikegerwitz.com>2013-06-04 22:42:47 -0400
committerMike Gerwitz <mike@mikegerwitz.com>2013-06-04 22:42:47 -0400
commit3ef671455137b9f6cbae905cc78a6e24c2202585 (patch)
tree7887bb0418e9763965352dd773a9a6d52aadfdc7
parentf04c9f24a84accdde73ab045171d858b4fcf88e7 (diff)
downloadrepo2html-tpl.tar.gz
repo2html-tpl.tar.bz2
repo2html-tpl.zip
Ensuring url_root will always contain forward slash when concatenated with creftpl
Trailing slash, if any, is stripped and explicitly added.
-rwxr-xr-xmsgfmt4
1 files changed, 2 insertions, 2 deletions
diff --git a/msgfmt b/msgfmt
index 3ee5563..8579a0c 100755
--- a/msgfmt
+++ b/msgfmt
@@ -57,7 +57,7 @@ done
refopar="${opar:+${opar%>} id="ref-\\1" class="ref">}"
# format the commit message, stopping at the diff (if any)
-awk -vid="$id" -vurl_root="$url_root" -vcref_errlog="$cref_errlog" '
+awk -vid="$id" -vurl_root="${url_root%/}" -vcref_errlog="$cref_errlog" '
# replace commit refs with generated URL (allows linking to prior commits
# without hard-coding the configurable links that could change or be
# relative to where the content is hosted); this will then be processed as a
@@ -76,7 +76,7 @@ awk -vid="$id" -vurl_root="$url_root" -vcref_errlog="$cref_errlog" '
printf id"\n" >>cref_errlog
}
- gsub(/\[cref:.*?\]/, url_root result)
+ gsub(/\[cref:.*?\]/, (url_root "/" result))
}
# stop printing at diff