pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:3859:    first_arg=my_get_arg(&_CDR(n), 0);    if(!first_arg) return 0;    t=first_arg[0]->type;    if(!t || match_types(t, object_type_string))    {    /* Skip any name-nodes. */    while(t && t->type == PIKE_T_NAME) {    t = t->cdr;    }    -  /* FIXME: Ought to handle or-nodes here. */ +  /* FIXME: Ought to handle or-nodes generically here. */ +  while (t && (t->type == T_OR)) { +  /* Handle some common cases. */ +  if ((t->car == zero_type_string) || (t->car == void_type_string)) { +  t = t->cdr; +  } else if ((t->cdr == zero_type_string) || (t->cdr == void_type_string)) { +  t = t->car; +  } else { +  break; +  } +  }    if(t && (t->type == T_OBJECT))    {    struct program *p = id_to_program(CDR_TO_INT(t));    if(p)    {    int fun=FIND_LFUN(p, lfun);       /* FIXME: function type string should really be compiled from    * the arguments so that or:ed types are handled correctly    */