FreeBSD Bugzilla – Attachment 214860 Details for
Bug 246735
Do not restrict fortune(6) to only searching for files named "fortunes" by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to allow fortune(6) to look for all fortune files in the fortune directory
fortune_always_check_all_fortunes.diff (text/plain), 1.85 KB, created by
Ruby Lazuli Lord
on 2020-05-26 04:30:05 UTC
(
hide
)
Description:
Patch to allow fortune(6) to look for all fortune files in the fortune directory
Filename:
MIME Type:
Creator:
Ruby Lazuli Lord
Created:
2020-05-26 04:30:05 UTC
Size:
1.85 KB
patch
obsolete
>--- usr.bin/fortune/fortune/fortune.orig.c 2020-03-19 02:25:53.655681000 -0500 >+++ usr.bin/fortune/fortune/fortune.c 2020-03-19 12:58:36.098855794 -0500 >@@ -99,7 +99,6 @@ > > static bool Found_one; /* did we find a match? */ > static bool Find_files = FALSE; /* just find a list of proper fortune files */ >-static bool Fortunes_only = FALSE; /* check only "fortunes" files */ > static bool Wait = FALSE; /* wait desired after fortune */ > static bool Short_only = FALSE; /* short fortune desired */ > static bool Long_only = FALSE; /* long fortune desired */ >@@ -366,33 +365,17 @@ > char **pstr; > > if (file_cnt == 0) { >- if (Find_files) { >- Fortunes_only = TRUE; >- pstr = Fortune_path_arr; >- i = 0; >- while (*pstr) { >- i += add_file(NO_PROB, *pstr++, NULL, >- &File_list, &File_tail, NULL); >- } >- Fortunes_only = FALSE; >- if (!i) { >- fprintf(stderr, "No fortunes found in %s.\n", >- Fortune_path); >- } >- return (i != 0); >- } else { >- pstr = Fortune_path_arr; >- i = 0; >- while (*pstr) { >- i += add_file(NO_PROB, "fortunes", *pstr++, >- &File_list, &File_tail, NULL); >- } >- if (!i) { >- fprintf(stderr, "No fortunes found in %s.\n", >- Fortune_path); >- } >- return (i != 0); >+ pstr = Fortune_path_arr; >+ i = 0; >+ while (*pstr) { >+ i += add_file(NO_PROB, *pstr++, NULL, >+ &File_list, &File_tail, NULL); > } >+ if (!i) { >+ fprintf(stderr, "No fortunes found in %s.\n", >+ Fortune_path); >+ } >+ return (i != 0); > } > for (i = 0; i < file_cnt; i++) { > percent = NO_PROB; >@@ -789,10 +772,6 @@ > DPRINTF(2, (stderr, "FALSE (file starts with '.')\n")); > return (FALSE); > } >- if (Fortunes_only && strncmp(sp, "fortunes", 8) != 0) { >- DPRINTF(2, (stderr, "FALSE (check fortunes only)\n")); >- return (FALSE); >- } > if ((sp = strrchr(sp, '.')) != NULL) { > sp++; > for (i = 0; suflist[i] != NULL; i++)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 246735
: 214860