aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/Hyperestraier_search_plug-in_defective.mdwn
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-23 12:40:31 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-02-23 12:40:31 +0000
commit0e8bed4e06c830ebcf4909b810e003a4aa29b2cb (patch)
treefd37a1cde369e0e93353d5aa95dc2c037bb6623d /doc/bugs/Hyperestraier_search_plug-in_defective.mdwn
parent5aaa61d842746a8a8a244859258f21836c6ac2a8 (diff)
downloadikiwiki-0e8bed4e06c830ebcf4909b810e003a4aa29b2cb.tar
ikiwiki-0e8bed4e06c830ebcf4909b810e003a4aa29b2cb.tar.gz
web commit by HenrikBrixAndersen: Indent
Diffstat (limited to 'doc/bugs/Hyperestraier_search_plug-in_defective.mdwn')
-rw-r--r--doc/bugs/Hyperestraier_search_plug-in_defective.mdwn74
1 files changed, 40 insertions, 34 deletions
diff --git a/doc/bugs/Hyperestraier_search_plug-in_defective.mdwn b/doc/bugs/Hyperestraier_search_plug-in_defective.mdwn
index 3ccdf8e2c..7f22e0eaf 100644
--- a/doc/bugs/Hyperestraier_search_plug-in_defective.mdwn
+++ b/doc/bugs/Hyperestraier_search_plug-in_defective.mdwn
@@ -1,43 +1,49 @@
The map() function used in the hyperestraier search plug-in doesn't work as intended as ilustrated by this simple script:
-#!/usr/bin/perl -w
-use strict;
-my @foo = (
- [ qw/foo bar baz/ ],
- [ qw/fee faa fum/ ],
- );
-# similar to current ikiwiki code (defective):
-my @bar = map { "/path/to/$_" foreach @{$_} } @foo;
-# this works:
-#my @bar = map { map { "/path/to/$_" } @{$_} } @foo;
-foreach (@bar) {
- print "$_\n";
-}
+ #!/usr/bin/perl -w
+ use strict;
+
+ my @foo = (
+ [ qw/foo bar baz/ ],
+ [ qw/fee faa fum/ ],
+ );
+
+ # similar to current ikiwiki code (defective):
+ my @bar = map { "/path/to/$_" foreach @{$_} } @foo;
+
+ # this works:
+ #my @bar = map { map { "/path/to/$_" } @{$_} } @foo;
+
+ foreach (@bar) {
+ print "$_\n";
+ }
Expected output:
-/path/to/foo
-/path/to/bar
-/path/to/baz
-/path/to/fee
-/path/to/faa
-/path/to/fum
+
+ /path/to/foo
+ /path/to/bar
+ /path/to/baz
+ /path/to/fee
+ /path/to/faa
+ /path/to/fum
Current output:
-Useless use of string in void context at perl-map.pl line 10.
+
+ Useless use of string in void context at perl-map.pl line 10.
The patch below fixes this issue:
---- IkiWiki/Plugin/search.pm.orig Thu Feb 1 23:52:03 2007
-+++ IkiWiki/Plugin/search.pm Thu Feb 1 23:52:41 2007
-@@ -64,8 +64,9 @@
- debug(gettext("updating hyperestraier search index"));
- estcmd("gather -cm -bc -cl -sd",
- map {
-- Encode::encode_utf8($config{destdir}."/".$_)
-- foreach @{$renderedfiles{pagename($_)}};
-+ map {
-+ Encode::encode_utf8($config{destdir}."/".$_)
-+ } @{$renderedfiles{pagename($_)}};
- } @_
- );
- estcfg(); \ No newline at end of file
+ --- IkiWiki/Plugin/search.pm.orig Thu Feb 1 23:52:03 2007
+ +++ IkiWiki/Plugin/search.pm Thu Feb 1 23:52:41 2007
+ @@ -64,8 +64,9 @@
+ debug(gettext("updating hyperestraier search index"));
+ estcmd("gather -cm -bc -cl -sd",
+ map {
+ - Encode::encode_utf8($config{destdir}."/".$_)
+ - foreach @{$renderedfiles{pagename($_)}};
+ + map {
+ + Encode::encode_utf8($config{destdir}."/".$_)
+ + } @{$renderedfiles{pagename($_)}};
+ } @_
+ );
+ estcfg(); \ No newline at end of file