Skip to content

Commit

Permalink
fix wrongly interpreted open() parameters
Browse files Browse the repository at this point in the history
thanks to Volker Kirsch
  • Loading branch information
dk committed Aug 29, 2024
1 parent 1d68b84 commit 986291c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Prima/sys/FS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ sub open(*;$*)
{
my ( $handle, @p ) = @_;
goto NATIVE unless @p;
$p[0] =~ m/^([\<\>\|\-\+\=\&]*])(.*)/ if 1 == @p;
if (1 == @p) {
if ( $p[0] =~ m/^([\<\>\|\-\+\=\&]+)(.*)/) {
@p = ($1, $2);
} else {
@p = ('<', $p[0]);
}
}
my ( $mode, $what, @rest) = @p;
goto NATIVE if !defined($what) || ref($what);
goto NATIVE if $what =~ /[\-\|\=\&]/;
goto NATIVE if $mode =~ /^[<>+]&/ || $mode =~ /^[-|]/ || $what =~ /[-|]$/;

my $flags;
my @layers;
Expand Down Expand Up @@ -80,6 +86,7 @@ sub open(*;$*)
return $ok;

NATIVE:
use Data::Dumper; print STDERR Dumper( \@_);
goto &CORE::open;
}

Expand Down

0 comments on commit 986291c

Please sign in to comment.