def strip_dots(path):
	"""Strip '.' and '..' components from path"""
	if (path == "/"):
		return path

	out = []
	for p in path[1:].split('/'):
		if p == "..":
			if len(out) != 0:
				del out[-1]
			else:
				out.append(p)
		elif p != ".":
			out.append(p)

	return "/" + "/".join(out)