pike.git / lib / modules / Protocols.pmod / IMAP.pmod / parse_line.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/IMAP.pmod/parse_line.pike:253:    * FIXME: This function is used to read fetch commands. This breaks    * rfc-2060 compliance, as the names of headers can be represented    * as string literals. */      mapping get_simple_list(int max_depth)   {    skip_whitespace();    if (!strlen(buffer))    return 0;    -  if (buffer[0] == '(') -  { +  if (buffer[0] == '(') {    /* Recurse */ -  if (max_depth > 0) -  { +  if (max_depth > 0) {    array a = do_parse_simple_list(max_depth - 1, ')');    return a && ([ "type": "list",    "list": a ]); -  } -  else +  } else { +  werror("get_simple_list(): Too deep recursion.\n");    return 0;    } -  +  }    return get_atom_options(max_depth);   }      array do_parse_simple_list(int max_depth, int terminator)   {    array a = ({ });    -  +  werror(sprintf("do_parse_simple_list(%d, '%c')\n", max_depth, terminator)); +     while(1)    {    buffer = buffer[1..];    skip_whitespace();       if (!strlen(buffer))    return 0;       if (buffer[0] == terminator)    {
pike.git/lib/modules/Protocols.pmod/IMAP.pmod/parse_line.pike:320:    {    res->raw = atom;    return res;    }       /* Parse options */    string option_start = buffer;       array options = do_parse_simple_list(max_depth - 1, ']');    -  if (strlen(buffer) && buffer[0] == ']') { -  buffer = buffer[1..]; -  } -  +     if (!options) { -  +  werror("get_atom_options(): No options.\n");    res->raw = atom + "[]";    res->options = ({ ([ "type":"atom", "atom":"" ]) });    return res;    }       res->options = options;    res->raw = atom + "[" +    option_start[..sizeof(option_start) - sizeof(buffer) - 1];