def _common_prefix(string_list):
    """
        Given a list of pathnames, returns the longest common leading component
    """
    if not string_list:
        return ""

    min_str = min(string_list)
    max_str = max(string_list)
    for i, c in enumerate(min_str):
        if c != max_str[i]:
            return min_str[:i]
    return min_str