Skip to content

Specifying percentage for "all" breaks if both FORTDIR and LOCFORTDIR have fortunes #79

@ralismark

Description

@ralismark

Demonstration:

$ fortune 70% all
fortune: probabilities sum to 140%!

This seems to be because FORTDIR and LOCFORTDIR both get separately added with the specified pecentage, instead of sharing the 70% between the two, so it effectively interprets it as fortune 70% <locfortdir> 70% <fortdir>.

I don't think fixing this is as simple as halving the percentage, since if the two directories have different numbers of fortunes, each fortunes in FORTDIR would have a different probability of showing up compared to ones in LOCFORTDIR. This would differ from what I'd expect if all the fortunes were in the same directory, where e.g. fortune 70% ./dir would still mean every fortune in dir has a roughly equal chance of appearing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions