aboutsummaryrefslogtreecommitdiffstats
path: root/bin/gtk-fair-viewer
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-03-02 11:01:18 -0500
committerJesús <heckyel@hyperbola.info>2020-03-02 11:01:18 -0500
commit30292e8da17c9ef68840a6da23f655a717d7a41f (patch)
treee9877e1202eb2f3cc82f4c95d9fc4f2d1b173db5 /bin/gtk-fair-viewer
parent0c6b88b1e851b3aae7ecaeb909d4fc5b8404679d (diff)
downloadfair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.tar.lz
fair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.tar.xz
fair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.zip
Workaround for List::Util < 1.45
Diffstat (limited to 'bin/gtk-fair-viewer')
-rwxr-xr-xbin/gtk-fair-viewer8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer
index 2053051..c8ef73b 100755
--- a/bin/gtk-fair-viewer
+++ b/bin/gtk-fair-viewer
@@ -647,6 +647,14 @@ foreach my $path($CONFIG{cache_dir}, $CONFIG{captions_dir}) {
require List::Util;
+ # Workaround for List::Util < 1.45
+ if (!defined(&List::Util::uniq)) {
+ *List::Util::uniq = sub {
+ my %seen;
+ grep { !$seen{$_}++ } @_;
+ };
+ }
+
# Keep only the most recent non-duplicated entries
@history = reverse(List::Util::uniq(reverse(@history)));
@search_history = List::Util::uniq(@search_history);