def remove_headers(headers, name):
    """Remove all headers with name *name*.

    The list is modified in-place and the updated list is returned.
    """
    i = 0
    name = name.lower()
    for j in range(len(headers)):
        if headers[j][0].lower() != name:
            if i != j:
                headers[i] = headers[j]
            i += 1
    del headers[i:]
    return headers