summaryrefslogtreecommitdiff
path: root/games/fortune
AgeCommit message (Collapse)Author
2018-09-15Fix fortune underlines and use the right number of underscores in Notes.Anthony J. Bentley
ok sthen@
2018-01-12apostrophe fix;Jason McIntyre
2017-11-25than -> thenTheo Buehler
from scott cheloha
2017-08-15typo: on -> ofTheo Buehler
From Scott Cheloha
2017-08-10Treat backspace as printable in sanitize() for non-UTF8 locales.Todd C. Miller
Fixes printing of fortunes that use a combination of backspace and underbars for underlining in non-UTF8 locales. OK schwarze@
2017-07-13Use an umlaut in Mobius and uppercase one instance of möbius visible inTheo Buehler
bentley's previous commit.
2017-07-13Convert fortunes to UTF-8 from the old "backspace punctuation" method.Anthony J. Bentley
suggested by tedu, ok schwarze@ stsp@ tb@
2017-07-12Inspect LC_CTYPE and if it isn't UTF-8, weed out bytes that are notIngo Schwarze
printable ASCII. That makes using UTF-8 in fortune datfiles safe. Potential usefulness of UTF-8 in fortune datfiles noticed by bentley@. OK tedu@ millert@.
2017-07-09Remove old junk. From Matthew MartinTheo Buehler
ok bentley
2017-06-30Add missing rot13 function prototypeRicardo Mestre
2017-06-12/usr/games/lib doesn't exist any more, use the new path.Michal Mazurek
OK tb@ deraadt@
2017-06-04Use proper bool types in fortune(6).Frederic Cambus
OK tb@, phessler@ (previous version)
2017-06-02Fix an infinite loop in fortune(6).Frederic Cambus
When invoking fortune with the -l option (to get long dictums only), the program gets stuck in an infinite loop because fortlen() doesn't return the fortune length correctly. OK mestre@, tb@, deraadt@, schwarze@
2016-11-05spelling fix from eric van gyzen, freebsd r308293;Jason McIntyre
2016-09-02Make build deterministic by not randomizing the datfiles themselves,Theo Buehler
random lines are selected on output and that's enough. From daniel, ok tb
2016-08-27the quotes in "unkempt thoughts" were authored by stanislaw lec,Jason McIntyre
not stanislaw lem (an easy blunder, i'd say); i've also inserted the "J." into one of these credits (Stanislaw J. Lec) since all the others have them; credit to antoni grzymala; diff pockled from netbsd
2016-03-07eliminate do_malloc() and do_free().tb
These are wrappers for malloc(3) and free(3) with NULL checks. do_free() is pointless since free() already checks for NULL. do_malloc() is used only three times, once asprintf(3) seems more appropriate, and for just two calls the benefit of a custom wrapper is minimal. ok millert@
2016-03-07Remove unused fields posfile and was_pos_file from FILEDESC andtb
simplify is_fortfile() accordingly. The last use of them was guarded by OK_TO_WRITE_DISK, which was unifdef'ed in revision 1.43 last fall. tweak + ok mestre@
2016-03-07- General changes:mestre
- Remove -? from getopt(3) options, but still keep (or add) -h where applicable - Replace hardcoded program strings by getprogname(3) - Specific changes: - atc(6): this used -? and -u for usage(), remove both from game and manpage - bcd(6): use __progname instead of getprogname(3), no need to include stdlib.h - hunt(6): replace fputs(3) by fprintf(3) OK tb@ after his suggestions
2016-03-05Convert a hand-rolled strtonum to a call to strtonum(3). This preventstb
integer overflow on bogus input and bizarre error messages. Moreover, fortune files can now be named anything except names matching the regex ^[0-9][0-9.]*%$ ok mestre@
2016-01-10As per style(9), remove remaining lint-style comments from games/mestre
OK tb@
2016-01-07Some basic code maintenance in games/tb
- in main() replace exit with return - drop some /* NOTREACHED */ lint comments along the way. - make more use of standard CFLAGS, esp. -Wimplicit-function-declaration - add and sort some headers when needed - add straightforward pledges to some programs used at compile time discussed with and ok mestre@
2016-01-04More headers removal and sorted the remaining alphabetically.mestre
Most noticeable that were removed are sys/types.h which will be included from stdlib.h and in turn also brings along sys/cdefs.h. The other one is limits.h that was used with the old idiom (denom * random() / LONG_MAX), although it was only removed were applicable (some files still need that header). OK tb@
2016-01-03About 13 years ago when the idiom srandom(time()), and sometimesmestre
srandom(time()+getpid()), was changed by srandomdev(), but #include <time.h> lived up until this day so remove it. Additionally, earlier than that, 18 years ago, random(6) was one of the first consumers of arc4random(3) family, and was pulling it from dev/rndvar.h but these days we pull it from stdlib.h, which is already done, so while here remove dev/rndvar.h also. "seems comprehensive to me" deraadt@ and OK tb@
2015-12-28update the us army democracy excerpt to more closelyJason McIntyre
match the format of the original; from andre smagin
2015-12-28andy finkel confimed himself as the originator of the rigged demo quote;Jason McIntyre
from netbsd pr 49451
2015-12-25Declare usage() functions as __dead void, if they don't return, on games ↵mestre
section. Found another one in arithmetic(6) which also didn't return, and removed a function from number(6) which is not used anymore. OK tb@
2015-11-15fix a double space issue in the following, rather wonderful, fortune:Jason McIntyre
On two occasions I have been asked [by members of Parliament!], `Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. -- Charles Babbage
2015-11-10another open(path, 0)...Theo de Raadt
2015-11-10pledge "stdio rpath" at the top. (Ricardo's 2nd chunk which reducesTheo de Raadt
further is not placed right, so I ignored it for now) from Ricardo Mestre
2015-11-10replace open(path, 0) with open(path, O_RDONLY). amazing to still findTheo de Raadt
sloppiness like this.
2015-10-24Cast ctype functions' argument to unsigned char.mmcc
ok guenther@
2015-10-24Cast isdigit()'s argument to unsigned char.mmcc
ok guenther@
2015-09-25use | rather than / for alternatives and some macro fixesIngo Schwarze
2015-09-16big blocks need braces for supportTed Unangst
2015-08-26remove #ifdef OK_TO_WRITE_DISK which isn't used by default.Sebastien Marie
and few disambiguisations suggested by cc(1) - parentheses around && within || - explicit braces to avoid ambiguous 'else' ok doug@
2015-04-04from snj, netbsd -r1.56: "properly pluralize"Jason McIntyre
2015-03-25Fix double word in quote from Ken Olsen.Jeremie Courreges-Anglas
"There is no reason for any individual to have a computer in their home."
2015-02-06Fix small typo found when testing tedu@'s fortune -o -m change.Kent R. Spillner
ok jmc@
2015-02-06unsigned char is the correct type for ctype functionsTed Unangst
2015-02-06no space after #Ted Unangst
2015-02-06remove TRUE/FALSE in favor of the true boolean values 1/0Ted Unangst
2015-02-06Debug, whatever it's worth, is clearly not a booleanTed Unangst
2015-02-06cleanup a few bitsTed Unangst
2015-02-06remove no regex ifdef. everybody loves regex.Ted Unangst
2015-02-06use regcomp native case insensitive matching facility instead ofTed Unangst
faking it poorly
2015-02-06don't set a flag with ++; it's a bool, not a counter.Ted Unangst
2015-02-06change int to size_t to avoid integer overflowTed Unangst
2015-02-06fix searching and display of offensive fortunes.Ted Unangst
now, if you want to find an offensive fortune about (e.g.) meat, you can simply run: $ fortune -o -m meat This is much easier than the previous requirement to run a command like: $ fortune -o -m `echo meat | rot13` | rot13 requested by guenther phessler
2015-02-06regex are documented in re_format.7, not the C API in regex.3Ted Unangst