pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
2010-11-15
2010-11-15 14:51:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>
0a7068127c019e99dd0e33f9e4177c18f293424d (
14
lines) (+
12
/-
2
)
[
Show
|
Annotate
]
Branch:
7.8
has_prefix() should not throw errors when the prefix is longer than the object supports.
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
||
$Id: builtin_functions.c,v 1.706 2010/09/28 16:06:35 mast Exp $
+
||
$Id$
*/ #include "global.h"
1081:
*! Returns @expr{1@} if the string @[s] starts with @[prefix], *! returns @expr{0@} (zero) otherwise. *!
+
*! When @[s] is an object, it needs to implement
+
*! @[lfun::_sizeof()] and @[lfun::`[]].
+
*!
*! @seealso *! @[has_suffix()], @[has_value()], @[search()] */
1101:
ptrdiff_t i; struct object *o = Pike_sp[-args].u.object; int inherit_no = Pike_sp[-args].subtype;
+
+
apply_lfun(o, LFUN__SIZEOF, 0);
+
if ((Pike_sp[-1].type != 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);