web commit by HenrikBrixAndersen: Indent
parent
5aaa61d842
commit
0e8bed4e06
|
@ -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:
|
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
|
#!/usr/bin/perl -w
|
||||||
use strict;
|
use strict;
|
||||||
my @foo = (
|
|
||||||
[ qw/foo bar baz/ ],
|
my @foo = (
|
||||||
[ qw/fee faa fum/ ],
|
[ qw/foo bar baz/ ],
|
||||||
);
|
[ qw/fee faa fum/ ],
|
||||||
# similar to current ikiwiki code (defective):
|
);
|
||||||
my @bar = map { "/path/to/$_" foreach @{$_} } @foo;
|
|
||||||
# this works:
|
# similar to current ikiwiki code (defective):
|
||||||
#my @bar = map { map { "/path/to/$_" } @{$_} } @foo;
|
my @bar = map { "/path/to/$_" foreach @{$_} } @foo;
|
||||||
foreach (@bar) {
|
|
||||||
print "$_\n";
|
# this works:
|
||||||
}
|
#my @bar = map { map { "/path/to/$_" } @{$_} } @foo;
|
||||||
|
|
||||||
|
foreach (@bar) {
|
||||||
|
print "$_\n";
|
||||||
|
}
|
||||||
|
|
||||||
Expected output:
|
Expected output:
|
||||||
/path/to/foo
|
|
||||||
/path/to/bar
|
/path/to/foo
|
||||||
/path/to/baz
|
/path/to/bar
|
||||||
/path/to/fee
|
/path/to/baz
|
||||||
/path/to/faa
|
/path/to/fee
|
||||||
/path/to/fum
|
/path/to/faa
|
||||||
|
/path/to/fum
|
||||||
|
|
||||||
Current output:
|
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:
|
The patch below fixes this issue:
|
||||||
|
|
||||||
--- IkiWiki/Plugin/search.pm.orig Thu Feb 1 23:52:03 2007
|
--- IkiWiki/Plugin/search.pm.orig Thu Feb 1 23:52:03 2007
|
||||||
+++ IkiWiki/Plugin/search.pm Thu Feb 1 23:52:41 2007
|
+++ IkiWiki/Plugin/search.pm Thu Feb 1 23:52:41 2007
|
||||||
@@ -64,8 +64,9 @@
|
@@ -64,8 +64,9 @@
|
||||||
debug(gettext("updating hyperestraier search index"));
|
debug(gettext("updating hyperestraier search index"));
|
||||||
estcmd("gather -cm -bc -cl -sd",
|
estcmd("gather -cm -bc -cl -sd",
|
||||||
map {
|
map {
|
||||||
- Encode::encode_utf8($config{destdir}."/".$_)
|
- Encode::encode_utf8($config{destdir}."/".$_)
|
||||||
- foreach @{$renderedfiles{pagename($_)}};
|
- foreach @{$renderedfiles{pagename($_)}};
|
||||||
+ map {
|
+ map {
|
||||||
+ Encode::encode_utf8($config{destdir}."/".$_)
|
+ Encode::encode_utf8($config{destdir}."/".$_)
|
||||||
+ } @{$renderedfiles{pagename($_)}};
|
+ } @{$renderedfiles{pagename($_)}};
|
||||||
} @_
|
} @_
|
||||||
);
|
);
|
||||||
estcfg();
|
estcfg();
|
Loading…
Reference in New Issue