Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions CHANGES.pod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ A reverse-chronological ordered list of changes
###############################################################################
###############################################################################

=head1 1.9 [????-??-??]

=head2 Fixes

=over 4

=item *

Removed POSIX::tempnam() deprecation warning.

=item *

Fixed over-escaping problem. "\\\\" now evaluates as "\\" instead of "\".

=item *

Added Win32 module prereqs to Makefile.PL.

=back


=head1 1.8.1 [2007-07-20]

=head2 Fixes
Expand Down
11 changes: 11 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ WriteMakefile (
PREREQ_PM => {
'Cwd' => '0',
'File::Spec' => '0',
'IO::File' => '0',
( $^O eq 'MSWin32'
? (
'Win32' => '0',
'Win32::TieRegistry' => '0.20',
'Win32::Process' => '0',
'Win32::Console' => '0',
'Win32::NetAdmin' => '0',
)
: ()
),
},
MAN1PODS => $pods,
PM => $pms,
Expand Down
8 changes: 7 additions & 1 deletion lib/Psh/OS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,16 @@ sub fb_signal_description {
}

# Return a name for a temp file

# Legacy security risk, but leaving in case
# anyone's using it. We're already loading
# POSIX anyway, and it gives its own warning.
sub fb_tmpnam {
return POSIX::tmpnam();
}
sub fb_tmpfile {
require IO::File;
return IO::File::new_tmpfile();
}

sub fb_get_window_size {}
sub fb_remove_signal_handlers {1}
Expand Down
14 changes: 5 additions & 9 deletions lib/Psh/OS/Unix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,19 @@ sub get_known_hosts {
# void display_pod(text)
#
sub display_pod {
my $tmp= Psh::OS::tmpnam();
my $tmpfh= Psh::OS::tmpfile();
my $text= shift;

local *TMP;
open( TMP,">$tmp");
print TMP $text;
close(TMP);
print $tmpfh $text;
$tmpfh->flush();
$tmpfh->seek(0,0); # rewind

eval {
require Pod::Text;
open STDOUT_SAVE, ">&", STDOUT;
Pod::Text::pod2text($tmp,*STDOUT_SAVE);
Pod::Text::pod2text($tmpfh);
};
Psh::Util::print_debug_class('e',"Error: $@") if $@;
print $text if $@;

unlink($tmp);
}

sub get_home_dir {
Expand Down
13 changes: 5 additions & 8 deletions lib/Psh/OS/Win.pm
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,18 @@ sub get_known_hosts {
# void display_pod(text)
#
sub display_pod {
my $tmp= Psh::OS::tmpnam();
my $tmpfh= Psh::OS::tmpfile();
my $text= shift;

open( TMP,">$tmp");
print TMP $text;
close(TMP);
print $tmpfh $text;
$tmpfh->flush();
$tmpfh->seek(0,0); # rewind

eval {
require Pod::Text;
open STDOUT_SAVE, ">&", STDOUT;
Pod::Text::pod2text($tmp,*STDOUT_SAVE);
Pod::Text::pod2text($tmpfh);
};
print $text if $@;

unlink($tmp);
}

sub inc_shlvl {
Expand Down
14 changes: 13 additions & 1 deletion lib/Psh/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,19 @@ sub remove_backslash {
$text=~ s/\\e/\e/g;
$text=~ s/\\(0[0-7][0-7])/chr(oct($1))/ge;
$text=~ s/\\(x[0-9a-fA-F][0-9a-fA-F])/chr(oct($1))/ge;
$text=~ s/\\(.)/$1/g;
#
#$text=~ s/\\(.)/$1/g;
#
# this breaks constructs like:
# > print "\\\\\n"
# \
# >
# should be:
# > print "\\\\\n"
# \\
# >
#

return $text;
}

Expand Down