Skip to content

Commit

Permalink
mosh Perl wrapper: Downgrade Perl regex to avoid named capture
Browse files Browse the repository at this point in the history
(Failed on Perl 5.8 with OS X 10.5)
  • Loading branch information
keithw committed Mar 11, 2013
1 parent 4668dc5 commit c6a8427
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/mosh
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,17 @@ if ( defined $predict ) {
}

if ( defined $port_request ) {
if ( $port_request =~ m{^(?<low>\d+)(:(?<high>\d+))?$} ) {
if ( $port_request =~ m{^(\d+)(:(\d+))?$} ) {
my ( $low, $clause, $high ) = ( $1, $2, $3 );
# good port or port-range
if ( $+{low} <= 0 or $+{low} >= 65535 ) {
die "$0: Server-side (low) port ($+{low}) must be within valid range [0..65535].\n";
if ( $low <= 0 or $low > 65535 ) {
die "$0: Server-side (low) port ($low) must be within valid range [1..65535].\n";
}
if ( defined $+{high} ) {
if ( $+{high} <= 0 or $+{high} >= 65535 ) {
die "$0: Server-side high port ($+{high}) must be within valid range [0..65535].\n";
if ( defined $high ) {
if ( $high <= 0 or $high > 65535 ) {
die "$0: Server-side high port ($high) must be within valid range [1..65535].\n";
}
if ( $+{low} > $+{high} ) {
if ( $low > $high ) {
die "$0: Server-side port range ($port_request): low port greater than high port.\n";
}
}
Expand Down

0 comments on commit c6a8427

Please sign in to comment.