--- rxvt-unicode/src/urxvt.pm 2006/01/17 17:01:54 1.98 +++ rxvt-unicode/src/urxvt.pm 2006/01/18 08:33:34 1.100 @@ -167,7 +167,9 @@ =item selection-pastebin This is a little rarely useful extension that Uploads the selection as -textfile to a remote site (or does other things). +textfile to a remote site (or does other things). (The implementation is +not currently secure for use in a multiuser environment as it writes to +F directly.). It listens to the C keyboard command, i.e. @@ -595,8 +597,6 @@ =cut BEGIN { - urxvt->bootstrap; - # overwrite perl's warn *CORE::GLOBAL::warn = sub { my $msg = join "", @_; @@ -619,24 +619,29 @@ warn "$msg\n" if $level <= $verbosity; } -my $extension_pkg = "extension0000"; my %extension_pkg; # load a single script into its own package, once only sub extension_package($) { my ($path) = @_; + no strict 'refs'; + $extension_pkg{$path} ||= do { - my $pkg = "urxvt::" . ($extension_pkg++); + $path =~ /([^\/\\]+)$/; + my $pkg = $1; + $pkg =~ s/[^[:word:]]/_/g; + $pkg = "urxvt::ext::$pkg"; verbose 3, "loading extension '$path' into package '$pkg'"; open my $fh, "<:raw", $path or die "$path: $!"; + @{"$pkg\::ISA"} = urxvt::term::extension::; + my $source = "package $pkg; use strict; use utf8;\n" - . "use base urxvt::term::extension::;\n" . "#line 1 \"$path\"\n{\n" . (do { local $/; <$fh> }) . "\n};\n1";