aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tinyurl-tabcomplete/complete-tiny-url.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/tinyurl-tabcomplete/complete-tiny-url.pl b/tinyurl-tabcomplete/complete-tiny-url.pl
index e3100e4..ead811c 100644
--- a/tinyurl-tabcomplete/complete-tiny-url.pl
+++ b/tinyurl-tabcomplete/complete-tiny-url.pl
@@ -16,7 +16,9 @@ $VERSION = '2.1';
sub do_complete {
my ($strings, $window, $word, $linestart, $want_space) = @_;
return if $word eq '';
- if (defined (my $found_uri = match_uri($word))) {
+ my $found_uri = match_uri($word);
+ if (defined $found_uri && $found_uri !~ m/tinyurl\./i) {
+ print "Going to reduce: $found_uri";
my $uri = makeashorterlink($found_uri);
push @$strings, $uri if $uri;
$$want_space = 1;
@@ -60,7 +62,7 @@ sub match_uri {
$uri = 'http://' . $uri if $uri !~ m(http://);
return $uri;
} else {
- return '';
+ return undef;
}
}