All pastes #422087 Raw Edit

Untitled

public python v1 · immutable
·published 2007-04-03 07:27 UTC
rendered paste body
def 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