shithub: mc

ref: a9a7d5b32a9423f871311384af6260a3848291d1
dir: /lib/std/hasprefix.myr/

View raw version
use "cmp"
pkg std =
	const hasprefix	: (s : byte[:], pre : byte[:] -> bool)
;;

const hasprefix = {s, pre
       match strncmp(s, pre, pre.len)
       | `Equal:       -> true
       | _:            -> false
       ;;
}