Changeset 72db971


Ignore:
Timestamp:
Jan 29, 2007, 11:02:02 PM (17 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
c18f08d
Parents:
29ebcea
git-author:
Nelson Elhage <nelhage@mit.edu> (01/29/07 23:01:58)
git-committer:
Nelson Elhage <nelhage@mit.edu> (01/29/07 23:02:02)
Message:
owl_text_quote no longer blows up if the string contains too many
characters that need quoting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • text.c

    r1bb1e67 r72db971  
    368368char *owl_text_quote(char *in, char *toquote, char *quotestr)
    369369{
    370   int i, x, r, place;
     370  int i, x, r, place, escape;
    371371  int in_len, toquote_len, quotestr_len;
    372372  char *out;
     
    377377  out=owl_malloc((in_len*quotestr_len)+30);
    378378  place=0;
     379  escape = 0;
     380  for (i=0; i<in_len; i++) {
     381    if(strchr(toquote, in[i]) != NULL)
     382      escape++;
     383  }
     384  out = owl_malloc(in_len + quotestr_len*escape+1);
    379385  for (i=0; i<in_len; i++) {
    380386
Note: See TracChangeset for help on using the changeset viewer.