1 (Note: this file has been re-arranged to be in reverse chronological
2 order, which is The Right Thing for ChangeLogs - DLC)
4 April 04, 2020 (fortune-mod 2.20.0)
6 Further avoid double traversal if FORTDIR == LOCFORTDIR.
8 Using clang-format to format the code.
10 Eliminate -D_FORTIFY_SOURCE warnings.
12 Modernize and refactor the code.
14 March 30, 2020 (fortune-mod 2.18.0)
16 Avoid double traversal if FORTDIR == LOCFORTDIR.
18 Typos' corrections and a new quote.
20 February 26, 2020 (fortune-mod 2.16.0)
22 Better portability to Microsoft Windows and other OSes
23 Thanks to AppVeyor (done by Shlomi Fish).
25 Add the -u flag [from debian]
27 Add fortune.desktop [from debian]
29 Remove backspaces in a cookie [from debian]
31 Complete the lyrics of a Leonard Cohen song [from debian]
33 Correct a misattribution.
35 February 23, 2020 (fortune-mod 2.14.0)
37 Correct some typos and add some new cookies.
39 Better Win32/Win64 Portability (AppVeyor is still failing.)
43 December 18, 2019 (fortune-mod 2.12.0)
45 Extract rinutils as a package and require it as a dep:
46 https://github.com/shlomif/rinutils/ .
48 Move some jokes to the offensive collection:
49 https://github.com/shlomif/fortune-mod/pull/38 - thanks
52 June 30, 2019 (fortune-mod 2.10.0)
54 Move strfile and unstr to /usr/bin :
55 https://github.com/shlomif/fortune-mod/issues/35
57 Code cleanups: warnings and portability.
59 Better porting to windows / appveyor-CI
62 June 07, 2019 (fortune-mod 2.8.0)
64 Add some quotes by amigojapan.
66 Some improvements for spelling, punctuation and grammar.
68 Extract a common C header.
72 December 19, 2018 (fortune-mod 2.6.2)
74 Fix the cmake files installation paths. See
75 https://github.com/shlomif/fortune-mod/pull/29 .
77 Some improvements for spelling, punctuation and grammar.
79 Normalize the numbering of "Great Moments in History":
80 https://github.com/shlomif/fortune-mod/issues/28 .
82 July 10, 2018 (fortune-mod 2.6.1)
84 Fix the previously rotated display of offensive fortunes (using the "-o"
85 or "-a" flags). See https://github.com/shlomif/fortune-mod/issues/26 .
87 Incorporate several more minor patches from Debian.
89 June 26, 2018 (fortune-mod 2.6.0)
91 Incorporate patches from the Debian package.
93 Add the "tao", "pratchett" and many individual cookies.
95 March 22, 2018 (fortune-mod 2.4.1)
97 Add the missing cmake/Shlomif_Common.cmake file.
99 March 22, 2018 (fortune-mod 2.4.0)
101 Fix issue #24 reported by @pouar of an underflow error in strfile.
103 Fix some GCC warnings with the Recode flags.
105 Remove some trailing empty lines in fortunes
107 February 15, 2018 (fortune-mod 2.2.1)
109 Fix some mispellings.
111 Remove some duplicates.
113 Thanks to bug reporters on the bug trackers of Linux distributions.
115 January 31, 2018 (fortune-mod 2.2.0)
117 Add the "disclaimer" cookie file (thanks to mathew).
119 Correct some problems in the documentation.
121 Fix some memory leaks (thanks to valgrind).
123 Reenable the valgrind tests (requires Recode 3.7).
125 January 11, 2018 (fortune-mod-2.0.0)
129 Deprecate the BSD_REGEX - we now use only POSIX ones.
133 March 25, 2017 (fortune-mod-1.99.5)
135 Add a new cmake-based configuration/build/install system.
137 Converted the source files to UTF-8.
139 Added automated tests.
141 Removed trailing whitespace.
143 Reformatted long (> 80 chars) lines.
147 Fixed some compiler warnings.
149 Added a build-time option to remove the “-o” (= “offensive”) flag.
151 Incorporated some downstream patches from Linux distributions.
154 March 05, 2004 (fortune-mod-1.99.1)
156 Most of the changes have occurred at some point in time in the last
159 A high number of spelling, punctuation, formatting and grammar
162 Internationalisation support.
164 New -c option to see which file a fortune came from.
168 Incorporated a couple of minor changes made in the (old) Debian
169 fortune-mod package, including the addition of an extra data file
170 called 'cookie'. Renamed some documentation files, and included some
171 install information for non-Linux users. Added a "-v" option to
172 report the program version.
174 I intend to submit this distribution to SunSITE RSN.
176 -- Dennis L. Clark <dbugger@progsoc.uts.edu.au>
180 This release fixes many of the portability problems with the
181 fortune-mod program released by Amy Lewis in October, 1995. The
182 previous version had many Linux-isms in it, which left it unworkable
183 on any other platform. This version replaces most of these with more
184 standard calls, making it more likely to work under other platforms.
185 The Makefiles have been modified so that GNU's gcc and make are no
186 longer required: any standard make and ANSI-compatible C compiler
187 should work. Sorry, pre-ANSI compilers are not supported (c'mon, this
188 is the 90's, darn it!)
190 This version has been tested to work on SunOS 4.1.x as well as Linux.
191 All changes made to the sources were as platform-independant as
192 possible. Therefore, no "#ifdef LINUX" or "#ifdef SUNOS4" directives
193 appear in the code. An effect of this is that a number of 'implicit
194 declaration' warnings are emitted by gcc under SunOS 4.1.x, but this a
195 problem with SunOS's standard headers, not with the program or the
196 compiler. The benefit of this approach is that it eases the work of
197 expanding the port to include other platforms. Bug reports and fixes
198 for other platforms are most welcome!
200 A few "standard" C function calls were replaced with more standard
201 counterparts at various points. Generally, when there was a choice
202 between a BSD version of a function and a POSIX version, the POSIX
203 version was favoured (even though fortune originated on BSD). An
204 exception to this was the regex functions: either POSIX or BSD
205 versions can be used, with selection made via the top-level Makefile.
207 Fortune and strfile also compiles on Solaris 2.5, but a discrepency
208 between the declaration and implementation of 'struct dirent' on the
209 test platform caused fortune to execute incorrectly there. It is not
210 certain whether this is a bug in the header file, the C library, or
213 While the making of this release was not meant to become a bug
214 search-and-destroy mission, some bugs were inadvertently discovered
215 and fixed. including the known bug of using -a with a file that occurs
216 in both the offensive and inoffensive directories. Fixing this
217 particular bug required a way to be able to separately identify two
218 fortune files with the same name, with one in the inoffensive
219 directory, the other one in the offensive directory. Now, such a name
220 will be taken to be the inoffensive file by default. However, you can
221 now append '-o' to a fortune name, and the '-o' will be removed and
222 the offensive directory will be searched. Thus you can say (assuming
223 you use the distributed datfiles):
225 fortune 80% politics politics-o
227 Which has an 80% change of giving an "inoffensive" political fortune,
228 and a 20% change of giving an "offensive" political one. Note that
229 this makes fortune-mod backwards-compatible with BSD fortune, but only
230 for users, not fortune database maintainers.
232 Of course, this solution only passes the buck: with the above example
233 again, if you have a 'politics-o' file in your inoffensive directory,
234 you are back to square one. OTOH, seeing that '-o' originally was
235 meant for offensive fortunes, using it for inoffensive ones is simply
238 Bug fixed: Fortune's definition of a fortune length (for -s and -l)
239 was inconsistent. Unordered fortunes counted the 2 delimiting
240 characters (as hinted in the man page), but sorted or randomized
241 fortunes did not. Now the delimiting characters are _NEVER_ counted,
242 so you will always get the length limit you expect.
244 Another bug fix: -l and -s can now work together with -m. Previously
245 -l and -s were ignored when -m was in effect. The new behaviour helps
246 me count how many long or short fortunes there are in a file.
248 Ansify has been removed from the package, as well as some filter
249 scripts from NetBSD that no longer appear useful. Randstr has been
250 kept, but has not been improved in any way. It at least has a man
251 page: maybe somebody will find it useful.
253 Some of the documentation (including the man pages) has been improved
254 and updated, and some files have been renamed so that the package
255 looks less Linux-specific.
257 -- Dennis L. Clark <dbugger@progsoc.uts.edu.au>
260 Ansify has been abandoned. I'm going to distribute this working version
261 of fortune, and then see how difficult it would be to add termcap/terminfo
262 enhancements to fortune itself--I don't anticipate serious problems, but
263 I'd rather go ahead and get this on the net.
265 A last-minute change was made to the way that percentages are displayed
266 with -f; it is now in the format nnn.nn%. The reason for this is that
267 with the multiplication of small files, fortune -af displayed a large
268 number of "0%"s--no worse than the old version, but not helpful.
270 The fortunes database was finally cleaned up, and this version is now
271 being distributed (at least, I hope it is). I don't consider the current
272 division of fortunes among files absolutely canonical; some are certainly
273 in the wrong places. But things are *better*.
275 Amy A. Lewis alewis@email.unc.edu
278 Another utility, ansify, now compiles; it has not been tested at all, so
279 it may not work even slightly.
281 Ansify is a rather stupid program, all things considered, but the work on
282 it does raise an interesting possibility for an enhanced fortune. At
283 present, the fortune databases contain x^Hy sequences for underline and
284 special characters (and this can be extended to include bold, = x^Hx).
285 Ansify is stupid because it doesn't use the proper tools, ie termcap or
286 terminfo (hmmm ... since it works on files, that may not be so stupid);
287 it appears that if that can be done, then a termcap/terminfo enhanced
288 fortune could be produced, which would recognize the existence of ^H in
289 a string and attempt to display using appropriate control sequences.
290 This sort of modification would be of greater interest to casual users,
291 I think, than even the bug fixes, and since it would not force changes
292 in the storage of fortunes, it is eminently portable. Consider this a
295 Added (early October 95):
296 A new executable, rot, which is a rot13 filter (a caesar cipher). Most
297 probably have caesar, but on the other hand, if you compile this mess
298 as root, caesar probably isn't in the path.
300 A new parameter to fortune, -n, which permits you to specify the length
301 at which to break between long (-l) and short (-s) fortunes.
303 fortune -f now shows probabilities.
305 A bug: fortune -a nn% filename filename ... now fails without an error
306 message, if the filename named following the percentage exists in both
307 the inoffensive and the offensive directories (that is, if you have two
308 files containing definitions, one called fortunes/definitions and one
309 called fortunes/off/definitions, and call fortune as: fortune -a 10%
310 definitions religion politics ..., then fortune simply fails). This
311 appears to be an artifact of the changes that were made in storage/
312 naming of offensive fortunes. It only happens with the combination of
313 a percentage with -a and inoffensive/offensive files that share a name.
314 Temporary workaround: rename one or the other of the files (*sigh* I
315 don't like that as a solution).
317 The man pages have been updated. The old man pages are also available,
318 but are not installed unless you do it yourself (the new ones are). The
319 new man pages have the extension .man; the old ones have numeric
322 A place has been created for fortune files containing HTML tags (the
323 reason I started playing with this mess was because I wanted to be
324 able to format fortunes nicely for the web without having to run an
325 enormously complex script to figure out from formatting how best to
326 display things, a particular problem since the formatting isn't
327 consistent). Tagged fortunes don't exist yet, and I'm seriously
328 considering creating a slightly different fortune binary that would
329 output the necessary headers and trailers (reducing the CGI script
330 to complete triviality) (-f isn't really needed for a webfortune).
332 Todo: I'm thinking of adding a -x to unstr, to rot13 the output. This
333 would have the effect of putting all the necessary tools in one package.
334 It further breaks compatibility with BSD tools (which has *mostly* been
335 maintained, merely enhanced slightly, although the change in how
336 offensive files are distinguished from inoffensive might be regarded as
337 breaking compatibility) by adding yet another parameter to unstr, which
338 didn't have any, before. So I haven't decided, yet.
340 Todo: KOI8 encoded fortunes? They couldn't be rotated without a great
341 deal of trouble, of course.
345 The way that fortune -m prints its output has been slightly changed. It
346 used to print the delimiter first, then, if this were the first fortune
347 from a particular file, it printed the name of the file in parentheses.
348 It now prints the first fortune without an initial delimiter; if the
349 fortune is the first from a particular file, it then prints
350 (filename), newline, delimiter, newline *to stderr*. Redirect stderr to
351 stdout to get something *similar to* (but not the same as) the old
352 behavior. The new behavior, if stderr is redirected to stdout, and
353 both are then redirected to a file, produces fictitious entries, one
354 per file in which a match was found. However, whether stderr is
355 redirected or not, the new format produces files that strfile can
356 parse without choking (the old format, since it placed the filename
357 on the same line as the delimiter character, effectively forced editing
358 of the file in order to make it usable by strfile, unless the option of
359 concatenating two fortunes with an ugly "% (filename)" line separating
360 them was considered acceptable output). Under the new display format,
361 if stderr is redirected into the file, you end up with filenames marking
362 the separation between files (as before), but they are now valid text
363 strings (which should probably, therefore, be deleted).
365 In other words, if you don't care what files the original text came from,
366 and want a new file containing (let us say), quotes from Mark Twain,
368 fortune -am '-- Mark Twain' >twain
369 The files accessed would march down the screen; the fortunes would be
370 stored in parsable format into the file twain. If, however, you planned
371 to edit (perhaps to remove the quotes from the original file, you might
372 then wish to redirect stderr to stdout. Using bash:
373 fortune -am '-- Mark Twain' &>twain
375 fortune -am '-- Mark Twain' >twain 2>&1
377 [The above is now in the man page, more or less]
380 Too many changes to mention, really. Look at the source code for
381 comments on individual files. LINUX.DIF has been removed.
383 It is worth noting that strfile was completely broken as distributed,
384 and fortune had code to make it report a different file list than the
385 one it used to retrieve fortunes. There's some rather strong language
386 on the subject in strfile.c; if it offends you, tough.
388 Bugs were fixed, and some enhancements were added. Unstr, in
389 particular, has had its command line considerably enhanced. Strfile
390 now *really does* sort, instead of merely setting the 'sorted' flag.
391 Ditto for randomizing.
393 Noteworthy: the way to distinguish between offensive and non-offensive
394 files has changed for fortune. A second directory (which may be a
395 subdirectory of the main fortune directory; the program doesn't
396 add files recursively down a directory tree) has been added to
397 pathnames.h. Offensive files should be placed there. There is no
398 longer any need to add the -o suffix to file names, and the problems
399 with finding files (especially offensive ones) seem to have
400 disappeared in the process.
402 Currently, I'm working on breaking the fortune files themselves into
403 smaller, more manageable pieces, checking spelling, punctuation, and
404 grammar, and trying to reduce redundancy. The eventual goal, after
405 the files are cleaned up, is another set of files carrying HTML tags,
406 which would then massively simplify a CGI script that calls fortune.
410 A 'randstr' (I want to call it 'lottery,' but I won't) utility, which
411 amounts to a poor woman's stripped-down fortune, to illustrate some
412 other possible uses of strfile-type random-access strings files.
414 Amy A. Lewis alewis@email.unc.edu