Untitled
public python v1 · immutabledef SplitBuf(buf): slash = False parv = [] i = 0 while i < len(buf): if buf[i] == ' ': i = i + 1 slash = False s = "" while i < len(buf) and (buf[i] != ' ' or slash): if buf[i] == '\\' and i+1 < len(buf) and (buf[i+1] == ' ' or buf[i+1] == '\\') and slash == False: slash = True else: s += buf[i] slash = False i = i + 1 parv.append(s) i = i + 1 return parv