def cygwin_to_windows_path(path):
    """Turn /cygdrive/c/foo into c:/foo, or return path if it
    is not a cygwin path.
    """
    if not path.startswith('/cygdrive/'):
        return path
    path = path[len('/cygdrive/'):]
    path = path[:1] + ':' + path[1:]
    return path