def cut
import ezx@1.11.0.0/src/sha/nar.bend as Narimport Base
244# the fields of a listing, each ended by a NUL, exactly as they were printed
245def cut(text: String) -> List<&2, String>:
246 match text:
247 case SNil{}:
248 []
249 case SCon{+c, t}:
250 cut.at(Char.is_eq(c, nul()), c, cut(t))