diff options
Diffstat (limited to 'kalyptus/kdocUtil.pm')
| -rw-r--r-- | kalyptus/kdocUtil.pm | 35 | 
1 files changed, 20 insertions, 15 deletions
diff --git a/kalyptus/kdocUtil.pm b/kalyptus/kdocUtil.pm index e045a67..f77c083 100644 --- a/kalyptus/kdocUtil.pm +++ b/kalyptus/kdocUtil.pm @@ -161,23 +161,28 @@ sub splitUnnested($$) {      my $depth = 0;      my $start = 0;      my $indoublequotes = 0; -    while($string =~ /($delim|<<|>>|[][}{)(><\"])/g) { +    my $insinglequotes = 0; +    while($string =~ /($delim|<<|>>|[][}{)(><\"\'])/g) {          my $c = $1; -        if(!$depth and !$indoublequotes and $c eq $delim) { -            my $len = pos($string) - $start - 1; -            push @ret, substr($string, $start, $len); -            $start = pos($string); -        } elsif($open{$c}) { -            $depth++; -        } elsif($close{$c}) { -            $depth--; -        } elsif($c eq '"') { -	    if ($indoublequotes) { -		$indoublequotes = 0; -	    } else { +	if(!$insinglequotes and !$indoublequotes) { +            if(!$depth and $c eq $delim) { +                my $len = pos($string) - $start - 1; +                push @ret, substr($string, $start, $len); +                $start = pos($string); +	    } elsif( $c eq "'") { +		$insinglequotes = 1; +            } elsif( $c eq '"') {  		$indoublequotes = 1; -	    } -	} +            } elsif($open{$c}) { +                $depth++; +            } elsif($close{$c}) { +                $depth--; +            } +	} elsif($c eq '"' and $indoublequotes) { +		$indoublequotes = 0; +	} elsif ($c eq "'" and $insinglequotes) { +		$insinglequotes = 0; +	}       }      my $subs = substr($string, $start);  | 
