This fixes this feature that is documented in the manual:
A plain name (i.e., not a path to a file or directory) that ends in “-o” will be assumed to be an offensive database, and will have its suffix stripped off and be searched in the offensive directory (even if the neither of the -a or -o options were specified).
An example of this is running fortune 90% politics 10% politics-o, which produces unoffensive political fortunes 90% of the time and offensive ones 10% of the time. Also supported is the special argument all-o, which corresponds to all offensive fortunes, so you can do e.g. fortune 90% all 10% all-o.
The existing code to handle *-o was quite broken and didn't run when it should. This change removes that and reimplements it in form_file_list(), which also avoids some duplication regarding how OFFDIR/LOCOFFDIR are used.
This fixes this feature that is documented in the manual:
An example of this is running
fortune 90% politics 10% politics-o
, which produces unoffensive political fortunes 90% of the time and offensive ones 10% of the time. Also supported is the special argumentall-o
, which corresponds to all offensive fortunes, so you can do e.g.fortune 90% all 10% all-o
.The existing code to handle
*-o
was quite broken and didn't run when it should. This change removes that and reimplements it in form_file_list(), which also avoids some duplication regarding how OFFDIR/LOCOFFDIR are used.