Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

consolidate_files returns unhelpful values #75

@icarus-sparry

Description

@icarus-sparry

consolidate_files sorts a linked list of files by name. It then walks the list and if the same name occurs multiple times it removes one of the duplicate names (it favors undeleted files over deleted ones, and renamed files over ones which have not been renamed). At the end it returns a pointer to the last file unless something went wrong, in which case it may return NULL.

As this is a doubly linked list, it is not a total disaster that it returns essentially the end of the list, but it would make more sense to return the start of the list. A typical use of this function is

server_manifest->files = consolidate_files(server_manifest->files);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions