Skip to content

Commit

Permalink
loose the split /,/ to split/\s*,\s*/
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Apr 27, 2010
1 parent 54c62fa commit c8cd34f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions bin/rt.in
Expand Up @@ -1514,15 +1514,15 @@ sub vsplit {
# XXX: This should become a real parser, à la Text::ParseWords.
$line =~ s/^\s+//;
$line =~ s/\s+$//;
my ( $a, $b ) = split /,/, $line, 2;
my ( $a, $b ) = split /\s*,\s*/, $line, 2;

while ($a) {
no warnings 'uninitialized';
if ( $a =~ /^'/ ) {
my $s = $a;
while ( $a !~ /'$/ || ( $a !~ /(\\\\)+'$/
&& $a =~ /(\\)+'$/ )) {
( $a, $b ) = split /,/, $b, 2;
( $a, $b ) = split /\s*,\s*/, $b, 2;
$s .= ',' . $a;
}
push @words, $s;
Expand All @@ -1531,7 +1531,7 @@ sub vsplit {
my $s = $a;
while ( $a !~ /}$/ ) {
( $a, $b ) =
split /,/, $b, 2;
split /\s*,\s*/, $b, 2;
$s .= ',' . $a;
}
$s =~ s/^q{/'/;
Expand All @@ -1541,7 +1541,7 @@ sub vsplit {
else {
push @words, $a;
}
( $a, $b ) = split /,/, $b, 2;
( $a, $b ) = split /\s*,\s*/, $b, 2;
}


Expand All @@ -1556,7 +1556,7 @@ sub expand_list {
my ($list) = @_;

my @elts;
foreach (split /,/, $list) {
foreach (split /\s*,\s*/, $list) {
push @elts, /^(\d+)-(\d+)$/? ($1..$2): $_;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/RT/Interface/REST.pm
Expand Up @@ -94,7 +94,7 @@ sub expand_list {
my ($list) = @_;

my @elts;
foreach (split /,/, $list) {
foreach (split /\s*,\s*/, $list) {
push @elts, /^(\d+)-(\d+)$/? ($1..$2): $_;
}

Expand Down
8 changes: 4 additions & 4 deletions share/html/REST/1.0/Forms/ticket/default
Expand Up @@ -368,14 +368,14 @@ else {
}
else {
my @new;
my ( $a, $b ) = split /,/, $val, 2;
my ( $a, $b ) = split /\s*,\s*/, $val, 2;
while ($a) {
no warnings 'uninitialized';
if ( $a =~ /^'/ ) {
my $s = $a;
while ( $a !~ /'$/ || ( $a !~ /(\\\\)+'$/
&& $a =~ /(\\)+'$/ ) ) {
( $a, $b ) = split /,/, $b, 2;
( $a, $b ) = split /\s*,\s*/, $b, 2;
$s .= ',' . $a;
}
$s =~ s/^'//;
Expand All @@ -386,7 +386,7 @@ else {
elsif ( $a =~ /^q{/ ) {
my $s = $a;
while ( $a !~ /}$/ ) {
( $a, $b ) = split /,/, $b, 2;
( $a, $b ) = split /\s*,\s*/, $b, 2;
$s .= ',' . $a;
}
$s =~ s/^q{//;
Expand All @@ -396,7 +396,7 @@ else {
else {
push @new, $a;
}
( $a, $b ) = split /,/, $b, 2;
( $a, $b ) = split /\s*,\s*/, $b, 2;
}

my %new;
Expand Down
2 changes: 1 addition & 1 deletion share/html/REST/1.0/dhandler
Expand Up @@ -210,7 +210,7 @@ if ($fields) {
$output = "Invalid field specification: $fields";
goto OUTPUT;
}
@fields = map lc, split /,/, $fields;
@fields = map lc, split /\s*,\s*/, $fields;
@fields{@fields} = ();
unless (exists $fields{id}) {
unshift @fields, "id";
Expand Down
2 changes: 1 addition & 1 deletion share/html/REST/1.0/search/ticket
Expand Up @@ -69,7 +69,7 @@ if ($fields) {
$output = "Invalid field specification: $fields";
goto OUTPUT;
}
@fields = map lc, split /,/, $fields;
@fields = map lc, split /\s*,\s*/, $fields;
@fields{@fields} = ();
unless (exists $fields{id}) {
unshift @fields, "id";
Expand Down

0 comments on commit c8cd34f

Please sign in to comment.