def getLineParts(line):
    """
    Split the UCI line into its whitespace-separated parts.

    Returns a list of strings, with apostrophes removed.
    """
    parts = line.split(" ")

    # Nothing to work with in this case. It is probably an erroneous line,
    # because they should usually have at least two parts.
    if len(parts) <= 1:
        return parts

    groups = []
    current = []

    while len(parts) > 0:
        word = parts.pop(0)

        # Suppress empty words that are not enclosed in quotations.
        if len(word) == 0:
            continue

        opening_quote = None
        if word.startswith("'") or word.startswith('"'):
            opening_quote = word[0]
            word = word[1:]

        closing_quote = None
        if opening_quote is not None and word.endswith(opening_quote):
            closing_quote = word[-1]
            word = word[:-1]

        group = [word]

        # Simple case: line part is a single word.
        if opening_quote is None or opening_quote == closing_quote:
            groups.append(group)
            continue

        # Build up a multi-word part until we find the closing quote.
        # Example: config ssid 'Free WiFi' # <- Space inside quotation marks.
        while len(parts) > 0:
            word = parts.pop(0)

            if word.endswith(opening_quote):
                closing_quote = word[-1]
                word = word[:-1]

            group.append(word)

            if opening_quote == closing_quote:
                break

        groups.append(group)

    return [" ".join(g) for g in groups]