pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1138:    if(TYPEOF(Pike_sp[1-args]) != T_STRING)    SIMPLE_ARG_TYPE_ERROR("has_prefix", 2, "string");       b = Pike_sp[1-args].u.string;       if (TYPEOF(Pike_sp[-args]) == T_OBJECT) {    ptrdiff_t i;    struct object *o = Pike_sp[-args].u.object;    int inherit_no = SUBTYPEOF(Pike_sp[-args]);    +  if (!o->prog || FIND_LFUN(o->prog, LFUN__SIZEOF) < 0) { +  Pike_error("has_prefix(): Object in argument 1 lacks lfun::_sizeof().\n"); +  } +     apply_lfun(o, LFUN__SIZEOF, 0);    if ((TYPEOF(Pike_sp[-1]) != T_INT) || (Pike_sp[-1].u.integer < b->len)) {    pop_n_elems(args + 1);    push_int(0);    return;    }       for (i = 0; i < b->len; i++) {    p_wchar2 ch = index_shared_string(b, i);    Pike_sp[-1].u.integer = i;