aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-10-03 14:14:30 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-10-03 14:16:28 -0400
commitffa73790b5c381df6e0385995b720dd24188969b (patch)
treee75b98405598f479e3986da4cc9341880fa67f78 /IkiWiki.pm
parente4eca63767a497ef696bb7757763f138114581e3 (diff)
downloadikiwiki-ffa73790b5c381df6e0385995b720dd24188969b.tar
ikiwiki-ffa73790b5c381df6e0385995b720dd24188969b.tar.gz
Fix a bug that could lead to duplicate links being recorded for tags.
Here I was bitten by perl's aliasing of foreach variables to the loop array contents, and match_link accidentially changed the contents of %links. In Jon's testcase, a tag added an absolute link, which was made relative by the above bug, and then the link was added again in preprocess, and turned into a duplicate.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 974e36902..2637f6017 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2052,10 +2052,10 @@ sub match_link ($$;@) {
else {
return IkiWiki::SuccessReason->new("$page links to page $p matching $link")
if match_glob($p, $link, %params);
- $p=~s/^\///;
+ my ($p_rel)=$p=~/^\/?(.*)/;
$link=~s/^\///;
- return IkiWiki::SuccessReason->new("$page links to page $p matching $link")
- if match_glob($p, $link, %params);
+ return IkiWiki::SuccessReason->new("$page links to page $p_rel matching $link")
+ if match_glob($p_rel, $link, %params);
}
}
return IkiWiki::FailReason->new("$page does not link to $link");