Changeset 7692


Ignore:
Timestamp:
2004-07-02T09:26:51+12:00 (20 years ago)
Author:
mdewsnip
Message:

Fixed up the parsing of quoted strings so strings like "Hello
" (with escaped backslashes before the quotes) are dealt with correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/cfgread.pm

    r3507 r7692  
    4242    if ($line =~ m/[^\\]([\"\'])/) {
    4343        my $quote=$1;
    44         while ($line !~ m/$quote(.*?[^\\])?$quote/) {
     44        while ($line !~ m/$quote(.*?[^\\])?(\\\\)*$quote/) {
    4545        my $nextline = <$handle>;
    4646        if (defined($nextline)) {
     
    5454    $linecontinues = $line =~ s/\\$//;
    5555
    56     while ($line =~ s/\s*(\".*?[^\\]\"|\'.*?[^\\]\'|\S+)\s*//) {
     56    while ($line =~ s/\s*(\".*?[^\\](\\\\)*\"|\'.*?[^\\](\\\\)*\'|\S+)\s*//) {
    5757        if (defined $1) {
    5858        # remove any enclosing quotes
Note: See TracChangeset for help on using the changeset viewer.