Changeset ef4700c


Ignore:
Timestamp:
Apr 16, 2010, 6:04:05 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
75b0adb
Parents:
6e58ff2
git-author:
Nelson Elhage <nelhage@mit.edu> (04/08/10 22:07:19)
git-committer:
Nelson Elhage <nelhage@mit.edu> (04/16/10 18:04:05)
Message:
Properly quote strings containing newlines or tabs.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl.pm

    rb30c256 ref4700c  
    363363        if ($str eq '') {
    364364            push @quoted, "''";
    365         } elsif ($str !~ /['" ]/) {
     365        } elsif ($str !~ /['" \n\t]/) {
    366366            push @quoted, "$str";
    367367        } elsif ($str !~ /'/) {
  • text.c

    rf7cd7c9 ref4700c  
    271271  if (strchr(line, '\'')) return("\"");
    272272  if (strchr(line, '"')) return("'");
    273   if (strchr(line, ' ')) return("'");
     273  if (strcspn(line, "\n\t ") != strlen(line)) return("'");
    274274  return("");
    275275}
Note: See TracChangeset for help on using the changeset viewer.