Compare commits
18 Commits
95d67d850c
...
0.7.10
Author | SHA1 | Date | |
---|---|---|---|
29a1add6f0
|
|||
0be2cf9fda
|
|||
a7920dedf3
|
|||
5cc84ca1bd
|
|||
af7c6c8ced
|
|||
7dd6f3d69d
|
|||
10a9440e57
|
|||
994cb03fe5
|
|||
c527aff34b
|
|||
3e8c80b8e0
|
|||
f7bdabb29d
|
|||
51cc5c6d69
|
|||
654d98cbb4
|
|||
8ad7b77cf3
|
|||
2063e7fcba
|
|||
85f4938776
|
|||
3db6edf467
|
|||
50316df104 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
Makefile
|
||||||
|
config.h
|
||||||
|
config.log
|
||||||
|
config.status
|
||||||
|
src/*.o
|
||||||
|
src/mboxgrep
|
384
ChangeLog
384
ChangeLog
@@ -1,384 +0,0 @@
|
|||||||
Mon Oct 23 01:29:07 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c, src/mbox.c, src/mbox.h, src/scan.c:
|
|
||||||
temporary mbox file (used for deleting messages) is now created
|
|
||||||
by tmpmbox_create(), tmpp global pointer is killed; portions of
|
|
||||||
code in scan.c are replaced by single call of mbox_write_message();
|
|
||||||
scan.c no longer includes zlib.h and bzlib.h
|
|
||||||
|
|
||||||
Thu Oct 19 03:50:38 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c, src/maildir.c, src/scan.c:
|
|
||||||
got rid off tmpp and maildir_count global variables (code
|
|
||||||
cleanup)
|
|
||||||
|
|
||||||
Thu Oct 19 03:38:24 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c, src/scan.c:
|
|
||||||
introduction of the global runtime_t structure; mailbox counter,
|
|
||||||
MD5 hash and other global variables are now part of it (code
|
|
||||||
cleanup)
|
|
||||||
|
|
||||||
Fri Jul 7 06:10:51 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/re.c, src/re.h, src/scan.c:
|
|
||||||
portions of scan_mailbox() have been moved to new functions,
|
|
||||||
pcre_match() and regex_match() (code cleanup)
|
|
||||||
|
|
||||||
Thu Jul 6 13:54:23 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/main.c, src/mboxgrep.h, src/re.c, src/re.h, src/scan.c:
|
|
||||||
main() has been partially uncluttered by moving portions of the
|
|
||||||
code to functions pcre_init() and regex_init()
|
|
||||||
|
|
||||||
Thu Jul 6 12:49:59 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/main.c, src/mboxgrep.h, src/misc.c, src/misc.h:
|
|
||||||
variables regex_s and haveregex are now part of the option_t
|
|
||||||
structure (code cleanup)
|
|
||||||
|
|
||||||
Thu Jul 6 10:26:57 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/main.c, src/misc.c, src/misc.h:
|
|
||||||
parts of main() have been moved to set_default_options() and
|
|
||||||
get_runtime_options() (code cleanup)
|
|
||||||
|
|
||||||
Sat Jul 1 13:06:37 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mbox.c, src/mbox.h:
|
|
||||||
file mode and ownership-altering code has been moved to a separate
|
|
||||||
function, tmpfile_mod_own (code cleanup)
|
|
||||||
|
|
||||||
Tue Jun 27 18:48:00 CEST 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mbox.c, src/mbox.h:
|
|
||||||
portions of the code from tmpfile_open moved to a new function,
|
|
||||||
tmpfile_name (code cleanup)
|
|
||||||
|
|
||||||
Mon Feb 20 18:09:59 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/maildir.c, src/mh.c:
|
|
||||||
removed some unused variables (have_return_path)
|
|
||||||
|
|
||||||
Mon Jan 30 01:35:30 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/maildir.c, src/mh.c, src/mbox.c, src/scan.c, src/main.c:
|
|
||||||
boxname, outboxname, pipecmd and tmpfilename are now a part of
|
|
||||||
the config_t structure and no longer global variables
|
|
||||||
|
|
||||||
Sat Jan 21 08:18:29 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/scan.c, src/misc.c, src/misc.h:
|
|
||||||
created postmark_print() to unclutter scan_mailbox()
|
|
||||||
|
|
||||||
Fri Jan 20 05:36:44 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/misc.c, src/misc.h, src/mbox.c, src/maildir.c, src/mh.c:
|
|
||||||
some repetitive code moved to malloc_message()
|
|
||||||
|
|
||||||
Fri Jan 20 05:13:06 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/mbox.c:
|
|
||||||
cleanup of mbox_write_message(); use of gzwrite_loop() and
|
|
||||||
bzwrite_loop()
|
|
||||||
|
|
||||||
Fri Jan 20 03:57:28 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/scan.c, src/wrap.h, src/wrap.c:
|
|
||||||
wrote gzwrite_loop() and bzwrite_loop() to remove some repetitive
|
|
||||||
code from scan.c
|
|
||||||
|
|
||||||
Fri Jan 20 02:11:50 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/scan.c:
|
|
||||||
md5_check_message(): array b and cast in strncmp are no longer
|
|
||||||
unsigned
|
|
||||||
|
|
||||||
Wed Jan 18 01:48:56 CET 2006 Daniel Spiljar <dspiljar@panix.com>
|
|
||||||
|
|
||||||
* src/info.c, src/mboxgrep.h:
|
|
||||||
updated copyright information, changed author's email address
|
|
||||||
to the one at Panix
|
|
||||||
|
|
||||||
Mon Apr 12 19:30:52 CEST 2004 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/info.c:
|
|
||||||
updated copyright information
|
|
||||||
|
|
||||||
Sun Apr 11 23:45:08 CEST 2004 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/mbox.h, src/mbox.c, src/scan.c, src/main.c:
|
|
||||||
mbox_write_message(); further fixes of message deletion code
|
|
||||||
|
|
||||||
Thu Sep 18 00:10:13 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/scan.c:
|
|
||||||
fixed deleting messages from mbox folders compressed with
|
|
||||||
bzip2
|
|
||||||
|
|
||||||
Thu Sep 18 00:08:36 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/main.c, src/mbox.c:
|
|
||||||
moved James P. Dugal's ownership-preserving code from main()
|
|
||||||
to tmpfile_open()
|
|
||||||
|
|
||||||
Sat Aug 30 23:13:01 CEST 2003 Vid Strpic <vms@bofhlet.net>
|
|
||||||
|
|
||||||
* src/info.c:
|
|
||||||
If bzip2 support is compiled in, `--help' command should list
|
|
||||||
`bz2mbox' as a valid option to `--mailbox-format='.
|
|
||||||
|
|
||||||
Sun Aug 24 21:49:52 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* doc/mboxgrep.1, doc/mboxgrep.texi:
|
|
||||||
small updates
|
|
||||||
|
|
||||||
Sat Aug 23 20:56:39 CEST 2003 James P. Dugal <jpd@louisiana.edu>
|
|
||||||
|
|
||||||
* src/main.c, src/mbox.h, src/mbox.c
|
|
||||||
If we are to use rename() to move a temp file (resulting from
|
|
||||||
deletions done in a mailbox) back over the original mailbox, we
|
|
||||||
must be sure the temp file is on the same file system. Also,
|
|
||||||
we should try to preserve the same ownership and permissions.
|
|
||||||
|
|
||||||
Mon Aug 11 00:39:14 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* configure.ac:
|
|
||||||
look for pcre-config(1) script; this effectively fixes a
|
|
||||||
compilation bug on recent RedHat Linux systems
|
|
||||||
|
|
||||||
Sun Apr 13 21:16:25 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/info.c, src/info.h:
|
|
||||||
print_wrap(); list of compile-time options is now printed wrapped
|
|
||||||
|
|
||||||
Mon Apr 7 01:24:20 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/mbox.c, src/wrap.c, src/wrap.h:
|
|
||||||
m_gzdopen()
|
|
||||||
|
|
||||||
Sun Apr 6 23:04:19 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/mbox.c, src/mbox.h, src/mboxgrep.h, src/misc.c, src/scan.c:
|
|
||||||
support for bzip2 compressed mailboxes
|
|
||||||
|
|
||||||
Fri Apr 4 00:14:01 CEST 2003 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* configure.ac:
|
|
||||||
check for libbz2
|
|
||||||
|
|
||||||
Sun Oct 27 23:57:31 CET 2002 Daniel Spiljar <dspiljar@world.std.com>
|
|
||||||
|
|
||||||
* src/mbox.c:
|
|
||||||
mbox_open() should now complain if called with an unknown argument
|
|
||||||
mode. Shouldn't normally happen, but...
|
|
||||||
|
|
||||||
Sun Aug 25 22:43:38 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/mbox.c, src/mbox.h, src/scan.c:
|
|
||||||
removed the gzmbox* functions in order to avoid code duplication;
|
|
||||||
as a side effect, mboxgrep can now read compressed mbox folders
|
|
||||||
from standard input
|
|
||||||
|
|
||||||
Sun Aug 11 01:36:02 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* configure.ac:
|
|
||||||
AC_HEADER_STDC, which fixed another compiler warning
|
|
||||||
|
|
||||||
Sat Aug 10 22:03:31 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/mbox.c, src/mh.c, src/scan.c, src/misc.c, src/maildir.c, src/mboxgrep.h:
|
|
||||||
made various code cleanups: got rid of a couple of global variables,
|
|
||||||
fixed compiler warnings and things like that
|
|
||||||
|
|
||||||
Sat Aug 10 00:35:21 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mh.h, src/wrap.h, src/mboxgrep.h:
|
|
||||||
removed some unnecessary #defines that have been causing compiler
|
|
||||||
errors
|
|
||||||
|
|
||||||
Sun Aug 4 20:11:29 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/scan.c, src/scan.h:
|
|
||||||
code clean up: moved recursive scan code from main()
|
|
||||||
to recursive_scan()
|
|
||||||
|
|
||||||
Wed Jul 24 00:20:59 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/maildir.c:
|
|
||||||
same thing with maildir as with MH below
|
|
||||||
|
|
||||||
Sat Jul 6 22:51:45 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mh.c:
|
|
||||||
MH module doesn't read files which aren't RFC 2822 messages anymore
|
|
||||||
|
|
||||||
Sat Jun 29 01:43:36 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* configure.in, src/maildir.c, src/main.c, src/mbox.c, src/mh.c, src/scan.c:
|
|
||||||
added debugging with dmalloc library
|
|
||||||
|
|
||||||
Sat Jun 29 01:39:21 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mbox.c, src/maildir.c:
|
|
||||||
fixed potential problem as with MH folders (below)
|
|
||||||
|
|
||||||
Sat Jun 29 01:28:30 CEST 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mh.c, src/scan.c:
|
|
||||||
(hopefully) fixed crashes on MH folders
|
|
||||||
|
|
||||||
Sat Feb 23 22:22:12 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mbox.c, src/maildir.c, src/mh.c, src/misc.c:
|
|
||||||
removed useless code that required strptime ()
|
|
||||||
|
|
||||||
Sat Feb 23 15:43:05 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/mbox.h, src/mbox.c, src/scan.c:
|
|
||||||
mboxgrep can now read mbox folders from standard input
|
|
||||||
|
|
||||||
Fri Feb 8 02:15:36 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c:
|
|
||||||
fixed a bug which prevented mboxgrep from being compiled;
|
|
||||||
this happened because I've put some assignments *before*
|
|
||||||
declarations
|
|
||||||
|
|
||||||
Wed Feb 6 23:11:50 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/maildir.c, src/main.c, src/mbox.c, src/mboxgrep.h, src/mh.c, src/mh.h, src/misc.c, src/scan.c, src/wrap.c
|
|
||||||
code cleanups; many global variables have been replaced with
|
|
||||||
a single option_t structure
|
|
||||||
|
|
||||||
Fri Feb 1 00:31:05 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/maildir.c:
|
|
||||||
fixed a bug which occured on recursive search of maildirs
|
|
||||||
|
|
||||||
Wed Jan 2 00:32:37 CET 2002 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/misc.c, src/wrap.h:
|
|
||||||
applied a patch (kindly submitted by John R. Daily
|
|
||||||
<jdaily@progeny.com>), which fixes missing prototypes that might
|
|
||||||
cause mboxgrep to coredump on IA64 platform
|
|
||||||
|
|
||||||
Sat Dec 15 20:12:40 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/scan.c, src/scan.h:
|
|
||||||
recursive search through directories has been reimplemented
|
|
||||||
|
|
||||||
Sat Dec 8 22:13:54 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/main.c, src/maildir.c:
|
|
||||||
replaced remaining occurences of malloc() with xmalloc()
|
|
||||||
|
|
||||||
Sat Dec 8 21:21:58 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/maildir.c, src/main.c, src/mbox.c, src/mh.c, src/misc.c, src/scan.c, src/wrap.c, src/wrap.h:
|
|
||||||
wrote xstrdup(), an error-checking wrapper around strdup() and
|
|
||||||
replaced all occurences of strdup() with xstrdup()
|
|
||||||
|
|
||||||
Sun Dec 2 18:05:57 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/Makefile.in, src/info.c, src/main.c, src/mboxgrep.h, src/md5.c, src/md5.h, src/scan.c, src/scan.h, doc/mboxgrep.texi:
|
|
||||||
mboxgrep can now ignore duplicate messages, thanks to the MD5
|
|
||||||
algorithm
|
|
||||||
|
|
||||||
* src/maildir.c, src/main.c, src/scan.c, src/wrap.c, src/wrap.h:
|
|
||||||
wrote xcalloc() and renamed m_realloc() to xrealloc()
|
|
||||||
|
|
||||||
Sat Nov 17 22:57:57 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mbox.c, src/mh.c, src/maildir.c
|
|
||||||
message->headers and message->body pointers are now initially malloc'd
|
|
||||||
to size of one character in order to prevent NULL pointers from being
|
|
||||||
passed to regexec()
|
|
||||||
|
|
||||||
Wed Nov 7 22:47:34 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* configure.ac, src/mboxgrep.h, src/main.c, src/misc.h, src/misc.c, src/info.c, src/config.h, src/mbox.c:
|
|
||||||
file locking method can now be selected at run time
|
|
||||||
|
|
||||||
* src/info.c, src/maildir.c, src/main.c, src/mbox.h, src/misc.c, src/scan.c, src/Makefile.in
|
|
||||||
changed `#include "config.h"' to `#include <config.h>', and fixed
|
|
||||||
other bugs with #including
|
|
||||||
|
|
||||||
Sat Nov 3 16:08:22 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* configure.ac, src/config.h.in, src/info.c, src/mbox.c
|
|
||||||
files can be locked with flock() instead of fcntl(), if
|
|
||||||
enabled at compile time
|
|
||||||
|
|
||||||
Sun Oct 28 19:01:44 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/Makefile.in:
|
|
||||||
forgot to mention getopt.c and getopt1.c
|
|
||||||
|
|
||||||
Sun Oct 28 16:06:28 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/mh.c, src/main.c, src/scan.c:
|
|
||||||
#included certain neccessary files
|
|
||||||
|
|
||||||
Sun Oct 28 14:43:21 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/maildir.c, src/maildir.h, src/scan.c:
|
|
||||||
wrote functions maildir_check and maildir_create;
|
|
||||||
if the target maildir doesn't exist, mboxgrep creates one;
|
|
||||||
if it does exist, mboxgrep checks its consistency and refuses to
|
|
||||||
write to it unless `tmp', `new' and `cur' subdirectories exist
|
|
||||||
|
|
||||||
Sun Oct 28 13:02:10 CET 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/info.c, doc/mboxgrep.texi, doc/mboxgrep.1
|
|
||||||
the "--regexp" command was implemented in version 0.7.0, but I
|
|
||||||
forgot to document it
|
|
||||||
|
|
||||||
Sat Oct 27 21:48:36 CEST 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/scan.c:
|
|
||||||
if the input is a non-mbox folder, a proper postmark line (with
|
|
||||||
date) is put on top of each message written to stdout
|
|
||||||
|
|
||||||
Mon Oct 8 22:53:34 CEST 2001 Daniel Spiljar <dspiljar@bofhlet.net>
|
|
||||||
|
|
||||||
* src/*:
|
|
||||||
source code now completely rewritten
|
|
||||||
|
|
||||||
Sun May 27 00:19:52 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* doc/mboxgrep.1:
|
|
||||||
updated the manual page -- it now refers to RFC 2822, instead
|
|
||||||
of the obsoleted 822
|
|
||||||
|
|
||||||
Tue May 1 15:06:03 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* configure.in, doc/Makefile.in, src/Makefile.in, Makefile.in:
|
|
||||||
moved manpage to the `doc' subdirectory; changed files above
|
|
||||||
accordingly
|
|
||||||
|
|
||||||
Sun Apr 15 23:00:08 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c, src/file.c, src/scan.c, src/info.c:
|
|
||||||
added support for writing messages to another mail folder
|
|
||||||
|
|
||||||
Mon Apr 9 21:55:15 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* src/file.c, src/scan.c: all calls of malloc() are now checked
|
|
||||||
and mboxgrep exits with code 2 if it fails to allocate memory
|
|
||||||
|
|
||||||
Sun Apr 8 19:40:33 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c: wrote mboxgrep_stat()
|
|
||||||
|
|
||||||
Sun Apr 8 16:58:36 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* src/mboxgrep.h, src/main.c: wrote mboxgrep_error()
|
|
||||||
|
|
||||||
Tue Mar 27 01:26:22 CEST 2001 Daniel Spiljar <dspiljar@public.srce.hr>
|
|
||||||
|
|
||||||
* configure.in: check for gethostname()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.59 2006-10-22 23:34:47 dspiljar Exp $
|
|
123
NEWS → NEWS.md
123
NEWS → NEWS.md
@@ -1,110 +1,129 @@
|
|||||||
Changes of mboxgrep
|
# Changes of mboxgrep
|
||||||
===================
|
|
||||||
|
|
||||||
Changes since 0.7.9
|
## Changes since 0.7.9
|
||||||
|
|
||||||
|
- development has been restarted after a longer hiatus
|
||||||
|
- moved the source tree to git
|
||||||
- fixed compile bug on FreeBSD and other systems
|
- fixed compile bug on FreeBSD and other systems
|
||||||
- fixed deleting messages mbox folders compressed with bzip2
|
- fixed deleting messages mbox folders compressed with bzip2
|
||||||
|
- fixed multiple compilation errors and warnings on Linux and FreeBSD
|
||||||
|
- started implementing a debug mode
|
||||||
|
|
||||||
|
## Changes since 0.7.8
|
||||||
|
|
||||||
Changes since 0.7.8
|
|
||||||
- implemented support for mbox folders compressed with bzip2 algorithm
|
- implemented support for mbox folders compressed with bzip2 algorithm
|
||||||
- improved detection of PCRE library; this also fixes a compilation bug
|
- improved detection of PCRE library; this also fixes a compilation bug
|
||||||
on recent RedHat Linux systems
|
on recent RedHat Linux systems
|
||||||
- fixed a problem with message deletion, which used to occur if an mbox
|
- fixed a problem with message deletion, which used to occur if an mbox
|
||||||
folder and temporary directory were on different filesystems;
|
folder and temporary directory were on different filesystems;
|
||||||
thanks to James P. Dugal <jpd@louisiana.edu> for providing a patch
|
thanks to James P. Dugal <jpd AT louisiana.edu> for providing a patch
|
||||||
|
|
||||||
|
## Changes since 0.7.7
|
||||||
|
|
||||||
Changes since 0.7.7
|
|
||||||
- fixed crashes on MH folders, as well as a potential problem with mbox
|
- fixed crashes on MH folders, as well as a potential problem with mbox
|
||||||
and maildir folders with the same cause
|
and maildir folders with the same cause
|
||||||
- debugging with dmalloc library
|
- debugging with the dmalloc library
|
||||||
- MH and maildir functions no longer read files which aren't RFC 2822 messages
|
- MH and maildir functions no longer read files which aren't RFC 2822 messages
|
||||||
- mboxgrep can now read gzip compressed mbox folders from standard input
|
- mboxgrep can now read gzip compressed mbox folders from standard input
|
||||||
(which is a side effect of a code cleanup!)
|
(which is a side effect of a code cleanup!)
|
||||||
|
|
||||||
Changes since 0.7.6a
|
## Changes since 0.7.6a
|
||||||
|
|
||||||
- mboxgrep can now read mbox folders from standard input
|
- mboxgrep can now read mbox folders from standard input
|
||||||
|
|
||||||
Changes since 0.7.6
|
## Changes since 0.7.6
|
||||||
|
|
||||||
- fixed a bug which prevented mboxgrep from being compiled
|
- fixed a bug which prevented mboxgrep from being compiled
|
||||||
|
|
||||||
Changes since 0.7.5
|
## Changes since 0.7.5
|
||||||
|
|
||||||
- fixed a bug which caused mboxgrep to coredump on recursive search of
|
- fixed a bug which caused mboxgrep to coredump on recursive search of
|
||||||
maildirs
|
maildirs
|
||||||
- code cleanups
|
- code cleanups
|
||||||
|
|
||||||
Changes since 0.7.4
|
## Changes since 0.7.4
|
||||||
|
|
||||||
- recursive search through directories has been reimplemented
|
- recursive search through directories has been reimplemented
|
||||||
|
|
||||||
Changes since 0.7.3
|
## Changes since 0.7.3
|
||||||
|
|
||||||
- mboxgrep can now ignore messages with identical bodies
|
- mboxgrep can now ignore messages with identical bodies
|
||||||
|
|
||||||
Changes since 0.7.2
|
## Changes since 0.7.2
|
||||||
|
|
||||||
- file locking method can be selected at runtime
|
- file locking method can be selected at runtime
|
||||||
- mboxgrep used to coredump on messages with empty headers; the problem is
|
- mboxgrep used to coredump on messages with empty headers; the problem is
|
||||||
now hopefully fixed
|
now hopefully fixed
|
||||||
- mboxgrep now compiles on FreeBSD
|
- mboxgrep now compiles on FreeBSD
|
||||||
|
|
||||||
Changes since 0.7.1
|
## Changes since 0.7.1
|
||||||
- file locking with flock() instead of fcntl() is now supported
|
|
||||||
- mboxgrep should now compile on systems which don't have getopt_long()
|
- file locking with `flock()` instead of `fcntl()` is now supported
|
||||||
|
- mboxgrep should now compile on systems which don't have `getopt_long()`
|
||||||
- other minor bugfixes
|
- other minor bugfixes
|
||||||
|
|
||||||
Changes since 0.7.0
|
## Changes since 0.7.0
|
||||||
|
|
||||||
- bugfixes
|
- bugfixes
|
||||||
|
|
||||||
Changes since 0.5.3
|
## Changes since 0.5.3
|
||||||
|
|
||||||
- NOTE: there was no stable version between 0.5.x and 0.7.x
|
- NOTE: there was no stable version between 0.5.x and 0.7.x
|
||||||
- mboxgrep is almost completely rewritten
|
- mboxgrep is almost completely rewritten
|
||||||
- implemented message deleting feature (--delete)
|
- implemented message deleting feature (`--delete`)
|
||||||
- implemented piping messages to a command (--pipe) (using this option,
|
- implemented piping messages to a command (`--pipe`) (using this option,
|
||||||
each selected message is piped to a separate instance of the specified
|
each selected message is piped to a separate instance of the specified
|
||||||
command)
|
command)
|
||||||
- added support for compressed mbox folders
|
- added support for compressed mbox folders
|
||||||
|
|
||||||
Changes since 0.5.2
|
## Changes since 0.5.2
|
||||||
|
|
||||||
- implemented ability to write found messages to another folder (instead
|
- implemented ability to write found messages to another folder (instead
|
||||||
of stdout)
|
of standard output)
|
||||||
- started writing *real* changelog (while this file has been renamed to
|
- started writing a *real* changelog (while this file has been renamed to
|
||||||
"NEWS")
|
"NEWS")
|
||||||
- wrote a manual in Texinfo format
|
- wrote a manual in Texinfo format
|
||||||
|
|
||||||
Changes since 0.5.1
|
## Changes since 0.5.1
|
||||||
- implemented message counting (-c, --count)
|
|
||||||
- fixed manual page installation target in src/Makefile.in -- manual page
|
- implemented message counting (`-c, --count`)
|
||||||
is now installed in $(manpath)/man1/ rather than in $(prefix)/man/man1/
|
- fixed manual page installation target in src/Makefile.in -- manual page
|
||||||
- added `--without-sense-of-humor' switch to the configure script, which
|
is now installed in `$(manpath)/man1/` rather than `$(prefix)/man/man1/`
|
||||||
disables checking whether Garfield still hates Mondays
|
- added `--without-sense-of-humor` switch to the configure script, which
|
||||||
- short version of `--version' switch is now `-V' instead of `-v',
|
disables checking whether Garfield still hates Mondays
|
||||||
because `-v' will be used for inverted matching
|
- short version of `--version` switch is now `-V` instead of `-v`,
|
||||||
- implemented inverted matching (-v, --invert-match)
|
because `-v` will be used for inverted matching
|
||||||
- implemented recursive search through directories (-r, --recursive)
|
- implemented inverted matching (`-v, --invert-match`)
|
||||||
- config.h[.in] is now wrapped (#ifndef CONFIG_H and stuff)
|
- implemented recursive search through directories (`-r, --recursive`)
|
||||||
|
- config.h[.in] is now wrapped (`#ifndef CONFIG_H` and stuff)
|
||||||
|
|
||||||
|
## Changes since 0.5.0
|
||||||
|
|
||||||
Changes since 0.5.0
|
|
||||||
- added support for qmail-style maildir folders
|
- added support for qmail-style maildir folders
|
||||||
|
|
||||||
Changes since 0.4.0
|
## Changes since 0.4.0
|
||||||
- source of getopt_long() is now included, so long options are also available
|
|
||||||
|
- the source of `getopt_long()` is now included, so long options are also available
|
||||||
on platforms that don't use GNU libc
|
on platforms that don't use GNU libc
|
||||||
- file locking is now performed on mbox folders only
|
- file locking is now performed on mbox folders only
|
||||||
|
|
||||||
Changes since 0.2.0
|
## Changes since 0.2.0
|
||||||
- added support for MH mailboxes
|
|
||||||
- added scope selection switches `-B' (or `--body') and `-H' (or `--headers')
|
- added support for MH mailboxes
|
||||||
- getopt() (or getopt_long(), if available) is now used to parse command line
|
- added scope selection switches `-B` (or `--body`) and `-H` (or `--headers`)
|
||||||
arguments, instead of my own lousy routine
|
- `getopt()` (or `getopt_long()`, if available) is now used to parse command line
|
||||||
- configure script now looks for PCRE by default, unless `--with-pcre=no' or
|
arguments, instead of my own lousy routine
|
||||||
`--without-pcre' is specified
|
- the configure script now looks for PCRE by default, unless `--with-pcre=no` or
|
||||||
- the feature of reading from standard input is gone
|
`--without-pcre` is specified
|
||||||
- added `-v' (or `--version') switch
|
- the feature of reading from standard input is gone
|
||||||
|
- added `-v` (or `--version`) switch
|
||||||
|
|
||||||
|
## Changes since 0.1.1
|
||||||
|
|
||||||
Changes since 0.1.1
|
|
||||||
- mboxgrep now puts a shared lock on a mailbox before reading it
|
- mboxgrep now puts a shared lock on a mailbox before reading it
|
||||||
- various code cleanups
|
- various code cleanups
|
||||||
|
|
||||||
Changes since 0.1.0
|
## Changes since 0.1.0
|
||||||
- fixed install target in Makefile (`install' is now used instead of `cp')
|
|
||||||
|
- fixed install target in Makefile (`install` is now used instead of `cp`)
|
||||||
- added support for mailboxes generated by Gnus
|
- added support for mailboxes generated by Gnus
|
||||||
|
|
||||||
|
|
||||||
$Id: NEWS,v 1.23 2004-04-11 21:48:53 dspiljar Exp $
|
|
44
TODO.md
44
TODO.md
@@ -1,21 +1,35 @@
|
|||||||
|
# The TODO list for mboxgrep
|
||||||
|
|
||||||
|
## Behavior
|
||||||
|
|
||||||
|
- [x] use cryptographic hashes for detecting duplicate messages
|
||||||
|
- [ ] add checking for conflicting command-line options
|
||||||
|
- [ ] support for deletion of messages after being matched and displayed
|
||||||
- [x] ignore .overview when grepping Gnus folders
|
- [x] ignore .overview when grepping Gnus folders
|
||||||
- [x] implement inverted matching
|
- [x] inverted matching
|
||||||
- [x] re-implement recursive search through directories
|
- [x] recursive search through directories
|
||||||
- [ ] implement literal date matching
|
- [x] writing selected messages to a new folder
|
||||||
|
- [x] deleting selected messages
|
||||||
|
- [ ] literal date matching
|
||||||
|
- [x] reading messages from standard input
|
||||||
|
- [x] run-time selection of file locking method
|
||||||
|
- [x] add a debug function
|
||||||
|
|
||||||
|
## File formats, encodings and standards
|
||||||
|
|
||||||
|
- [ ] MIME support
|
||||||
|
- [ ] support for GnuPG
|
||||||
|
- [x] support for compressed mbox folders
|
||||||
|
- [x] support for bzip2 compression
|
||||||
|
- [ ] support for XZ-format compression
|
||||||
|
- [ ] support for mail folder conversion
|
||||||
|
- [ ] use a more modern hash function than MD5
|
||||||
|
|
||||||
|
## Miscellaneous
|
||||||
|
|
||||||
- [x] write Texinfo documentation
|
- [x] write Texinfo documentation
|
||||||
- [x] implement writing selected messages to a new folder
|
- [ ] configuration files
|
||||||
- [x] implement deleting selected messages
|
|
||||||
- [ ] add support for config files
|
|
||||||
- [x] add support for reading messages from stdin
|
|
||||||
- [x] add support for compressed mbox folders
|
|
||||||
- [ ] make use of lockfile library
|
- [ ] make use of lockfile library
|
||||||
- [ ] make use of Solaris' maillock library
|
- [ ] make use of Solaris' maillock library
|
||||||
- [x] provide possibility to use flock() instead of fcntl()
|
- [x] provide possibility to use flock() instead of fcntl()
|
||||||
- [ ] provide national language support with gettext()
|
- [ ] provide national language support with gettext()
|
||||||
- [x] allow run-time selection of file locking method
|
|
||||||
- [ ] make mboxgrep understand MIME
|
|
||||||
- [x] enable removing duplicate messages w/ MD5 checksums
|
|
||||||
- [ ] add checking for conflicting command-line options
|
|
||||||
- [ ] add support for GnuPG
|
|
||||||
- [x] add support for bzip2 compression
|
|
||||||
- [ ] add support for mail folder conversion
|
|
||||||
|
@@ -1,5 +0,0 @@
|
|||||||
This directory is intended to hold third-party contributions.
|
|
||||||
|
|
||||||
- mboxgrep.spec is an RPM spec file, kindly contributed by
|
|
||||||
Vaclav Slavik <v.slavik@volny.cz>
|
|
||||||
|
|
3
contrib/README.md
Normal file
3
contrib/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
This directory is intended to hold third-party contributions.
|
||||||
|
|
||||||
|
- mboxgrep.spec is an RPM spec file, kindly contributed by Vaclav Slavik <v.slavik AT volny.cz>
|
@@ -1,5 +1,4 @@
|
|||||||
.Id $Id: mboxgrep.1,v 1.16 2006-01-18 00:09:58 dspiljar Exp $
|
.TH MBOXGREP 1 "17 Feb 2023"
|
||||||
.TH MBOXGREP 1 "26 Jan 2023"
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
mboxgrep \- displays email messages matching a pattern
|
mboxgrep \- displays email messages matching a pattern
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@@ -84,14 +83,18 @@ caution.
|
|||||||
Ignore duplicate messages.
|
Ignore duplicate messages.
|
||||||
.IP "-m, --mailbox-format=TYPE"
|
.IP "-m, --mailbox-format=TYPE"
|
||||||
Select input and output mailbox TYPE. TYPE can be either `mbox' (default),
|
Select input and output mailbox TYPE. TYPE can be either `mbox' (default),
|
||||||
`zmbox' (meaning `gzip compressed mbox'), `bz2mbox' (meaning `bzip2
|
`zmbox' (gzip compressed mbox), `bz2mbox' (bzip2 compressed mbox), `mh', `nnml',
|
||||||
compressed mbox'), `mh', `nnml', `nnmh' or `maildir'.
|
`nnmh' or `maildir'.
|
||||||
|
.IP "-s, --no-messages"
|
||||||
|
Suppress most error messages.
|
||||||
|
.IP "--debug"
|
||||||
|
Print messages useful for debugging.
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
.TP
|
.TP
|
||||||
\(bu
|
\(bu
|
||||||
Search $MAIL for messages from Dirty Harry:
|
Search $MAIL for messages from Dirty Harry:
|
||||||
.PP
|
.PP
|
||||||
mboxgrep '^From:.*callahan@homicide\\.SFPD\\.gov' $MAIL
|
mboxgrep '^From:.*callahan@sanfranciscopolice\\.org' $MAIL
|
||||||
.TP
|
.TP
|
||||||
\(bu
|
\(bu
|
||||||
Display all messages contained in folder ~/Mail/incoming, except those
|
Display all messages contained in folder ~/Mail/incoming, except those
|
||||||
@@ -100,9 +103,6 @@ that appear to originate from AOL:
|
|||||||
mboxgrep -v 'Received:.*aol\\.com' ~/Mail/incoming
|
mboxgrep -v 'Received:.*aol\\.com' ~/Mail/incoming
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
Report them to address below.
|
Report them to address below.
|
||||||
.SH NOTICE
|
|
||||||
Mboxgrep was alomost completely rewritten since version 0.5.3. Additionally,
|
|
||||||
there was no stable 0.6.x branch between 0.5.3 and 0.7.0.
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
grep(1),
|
grep(1),
|
||||||
regex(7),
|
regex(7),
|
||||||
|
@@ -169,6 +169,9 @@ options below change such behavior.
|
|||||||
'-s'
|
'-s'
|
||||||
Suppress error messages.
|
Suppress error messages.
|
||||||
|
|
||||||
|
'--debug'
|
||||||
|
Print messages useful for debugging.
|
||||||
|
|
||||||
|
|
||||||
File: mboxgrep.info, Node: Search scope selection, Next: Mailbox type selection, Prev: Output control, Up: Invoking
|
File: mboxgrep.info, Node: Search scope selection, Next: Mailbox type selection, Prev: Output control, Up: Invoking
|
||||||
|
|
||||||
@@ -197,7 +200,7 @@ File: mboxgrep.info, Node: Examples, Next: Bugs, Prev: Invoking, Up: Top
|
|||||||
|
|
||||||
Scan '$MAIL' for messages from Dirty Harry:
|
Scan '$MAIL' for messages from Dirty Harry:
|
||||||
|
|
||||||
mboxgrep -H '^From:.*callahan@homicide\.SFPD\.gov' $MAIL
|
mboxgrep -H '^From:.*callahan@sanfranciscopolice\.org' $MAIL
|
||||||
|
|
||||||
Re-mail to George messages that mention his name:
|
Re-mail to George messages that mention his name:
|
||||||
|
|
||||||
@@ -224,11 +227,11 @@ File: mboxgrep.info, Node: Bugs, Next: To Vicky, Prev: Examples, Up: Top
|
|||||||
******************
|
******************
|
||||||
|
|
||||||
Shortly, if 'mboxgrep' crashes and/or works differently than described
|
Shortly, if 'mboxgrep' crashes and/or works differently than described
|
||||||
in this manual, you've found a bug.
|
in this manual, you have found a bug.
|
||||||
|
|
||||||
Please report bugs to <dspiljar@datatipp.se>. Instructions how to
|
Please report bugs to <dspiljar@datatipp.se>. Instructions how to
|
||||||
reproduce the bug or output from a debugger would be highly appreciated.
|
reproduce the bug or output from a debugger would be highly appreciated.
|
||||||
Don't, however, send any coredumps.
|
Please do not, however, send any core dumps.
|
||||||
|
|
||||||
|
|
||||||
File: mboxgrep.info, Node: To Vicky, Prev: Bugs, Up: Top
|
File: mboxgrep.info, Node: To Vicky, Prev: Bugs, Up: Top
|
||||||
@@ -253,11 +256,11 @@ Node: Miscellaneous1827
|
|||||||
Node: File locking2112
|
Node: File locking2112
|
||||||
Node: Regexp selection2749
|
Node: Regexp selection2749
|
||||||
Node: Output control3301
|
Node: Output control3301
|
||||||
Node: Search scope selection4292
|
Node: Search scope selection4345
|
||||||
Node: Mailbox type selection4533
|
Node: Mailbox type selection4586
|
||||||
Node: Examples4854
|
Node: Examples4907
|
||||||
Node: Bugs5674
|
Node: Bugs5731
|
||||||
Node: To Vicky6081
|
Node: To Vicky6149
|
||||||
|
|
||||||
End Tag Table
|
End Tag Table
|
||||||
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
\input texinfo @c -*-texinfo-*-
|
\input texinfo
|
||||||
@c $Id: mboxgrep.texi,v 1.20 2006-01-18 00:09:58 dspiljar Exp $
|
|
||||||
@setfilename mboxgrep.info
|
@setfilename mboxgrep.info
|
||||||
@settitle Grep through mailboxes
|
@settitle Grep through mailboxes
|
||||||
@finalout
|
@finalout
|
||||||
@@ -7,7 +6,7 @@
|
|||||||
|
|
||||||
@set EDITION 0.7
|
@set EDITION 0.7
|
||||||
@set VERSION 0.7.10
|
@set VERSION 0.7.10
|
||||||
@set UPDATED 26 Jan 2023
|
@set UPDATED 17 Feb 2023
|
||||||
|
|
||||||
@dircategory Mail
|
@dircategory Mail
|
||||||
@direntry
|
@direntry
|
||||||
@@ -189,6 +188,9 @@ instance of COMMAND.
|
|||||||
@itemx -s
|
@itemx -s
|
||||||
Suppress error messages.
|
Suppress error messages.
|
||||||
|
|
||||||
|
@item --debug
|
||||||
|
Print messages useful for debugging.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Search scope selection, Mailbox type selection, Output control, Invoking
|
@node Search scope selection, Mailbox type selection, Output control, Invoking
|
||||||
@@ -224,7 +226,7 @@ mbox) @code{mh}, @code{nnml}, @code{nnmh}, and @code{maildir}.
|
|||||||
Scan @env{$MAIL} for messages from Dirty Harry:
|
Scan @env{$MAIL} for messages from Dirty Harry:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
mboxgrep -H '^From:.*callahan@@homicide\.SFPD\.gov' $MAIL
|
mboxgrep -H '^From:.*callahan@@sanfranciscopolice\.org' $MAIL
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Re-mail to George messages that mention his name:
|
Re-mail to George messages that mention his name:
|
||||||
@@ -258,11 +260,11 @@ mboxgrep -nd -c . spam
|
|||||||
@cindex bug, insect, vermin, bugreport
|
@cindex bug, insect, vermin, bugreport
|
||||||
|
|
||||||
Shortly, if @code{mboxgrep} crashes and/or works differently than described
|
Shortly, if @code{mboxgrep} crashes and/or works differently than described
|
||||||
in this manual, you've found a bug.
|
in this manual, you have found a bug.
|
||||||
|
|
||||||
Please report bugs to @email{dspiljar@@datatipp.se}.
|
Please report bugs to @email{dspiljar@@datatipp.se}.
|
||||||
Instructions how to reproduce the bug or output from a debugger would be
|
Instructions how to reproduce the bug or output from a debugger would be
|
||||||
highly appreciated. Don't, however, send any coredumps.
|
highly appreciated. Please do not, however, send any core dumps.
|
||||||
|
|
||||||
@node To Vicky, , Bugs, Top
|
@node To Vicky, , Bugs, Top
|
||||||
@chapter Author's Dedication
|
@chapter Author's Dedication
|
||||||
|
16
src/info.c
16
src/info.c
@@ -30,7 +30,7 @@ void
|
|||||||
print_wrap (char *str, int len, int *n)
|
print_wrap (char *str, int len, int *n)
|
||||||
{
|
{
|
||||||
*n += len;
|
*n += len;
|
||||||
fprintf (stdout, str);
|
fprintf (stdout, "%s", str);
|
||||||
if (*n >= 50)
|
if (*n >= 50)
|
||||||
{
|
{
|
||||||
fprintf (stdout, "\n");
|
fprintf (stdout, "\n");
|
||||||
@@ -88,7 +88,16 @@ version (void)
|
|||||||
#endif /* HAVE_SYS_DIR_H */
|
#endif /* HAVE_SYS_DIR_H */
|
||||||
#ifdef HAVE_SYS_NDIR_H
|
#ifdef HAVE_SYS_NDIR_H
|
||||||
print_wrap ("HAVE_SYS_NDIR_H", 15, &n);
|
print_wrap ("HAVE_SYS_NDIR_H", 15, &n);
|
||||||
#endif
|
#endif /* HAVE_SYS_NDIR_H */
|
||||||
|
#ifdef HAVE_STRPTIME
|
||||||
|
print_wrap ("HAVE_STRPTIME", 15, &n);
|
||||||
|
#endif /* HAVE_STRPTIME */
|
||||||
|
#ifdef HAVE_REGCOMP
|
||||||
|
print_wrap ("HAVE_REGCOMP", 15, &n);
|
||||||
|
#endif /* HAVE_REGCOMP */
|
||||||
|
#ifdef HAVE_LIBDMALLOC
|
||||||
|
print_wrap ("HAVE_LIBDMALLOC", 15, &n);
|
||||||
|
#endif /* HAVE_LIBDMALLOC */
|
||||||
fprintf (stdout, "\n");
|
fprintf (stdout, "\n");
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
@@ -111,7 +120,8 @@ help (void)
|
|||||||
" -nd, --no-duplicates\t\tIgnore duplicate messages\n"
|
" -nd, --no-duplicates\t\tIgnore duplicate messages\n"
|
||||||
" -o, --output=MAILBOX\t\tWrite messages to MAILBOX\n"
|
" -o, --output=MAILBOX\t\tWrite messages to MAILBOX\n"
|
||||||
" -p, --pipe=COMMAND\t\tPipe each found message to COMMAND\n"
|
" -p, --pipe=COMMAND\t\tPipe each found message to COMMAND\n"
|
||||||
" -s, --no-messages\t\tSuppress most error messages\n\n"
|
" -s, --no-messages\t\tSuppress most error messages\n"
|
||||||
|
" --debug\t\t\tPrint messages useful for debugging\n\n"
|
||||||
"Matching criteria:\n\n"
|
"Matching criteria:\n\n"
|
||||||
" -E, --extended-regexp\tPATTERN is an extended regular expression\n"
|
" -E, --extended-regexp\tPATTERN is an extended regular expression\n"
|
||||||
" -G, --basic-regexp\t\tPATTERN is a basic regular expression\n");
|
" -G, --basic-regexp\t\tPATTERN is a basic regular expression\n");
|
||||||
|
@@ -122,7 +122,7 @@ maildir_read_message (maildir_t *mdp)
|
|||||||
static FILE *fp;
|
static FILE *fp;
|
||||||
static int s;
|
static int s;
|
||||||
|
|
||||||
message = malloc_message ();
|
message = allocate_message ();
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
|
82
src/main.c
82
src/main.c
@@ -48,8 +48,6 @@ runtime_t runtime;
|
|||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
/* {{{ */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int havemailbox = 0;
|
int havemailbox = 0;
|
||||||
int singlefile = 0;
|
int singlefile = 0;
|
||||||
@@ -57,8 +55,6 @@ main (int argc, char **argv)
|
|||||||
runtime.maildir_count = 0;
|
runtime.maildir_count = 0;
|
||||||
|
|
||||||
static struct option long_options[] =
|
static struct option long_options[] =
|
||||||
/* {{{ */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
{"count", 0, 0, 'c'},
|
{"count", 0, 0, 'c'},
|
||||||
{"delete", 0, 0, 'd'},
|
{"delete", 0, 0, 'd'},
|
||||||
@@ -80,13 +76,12 @@ main (int argc, char **argv)
|
|||||||
{"output", 1, 0, 'o'},
|
{"output", 1, 0, 'o'},
|
||||||
{"no-duplicates", 0, 0, 200},
|
{"no-duplicates", 0, 0, 200},
|
||||||
{"no-file-lock", 0, 0, 201},
|
{"no-file-lock", 0, 0, 201},
|
||||||
|
{"debug", 0, 0, 202},
|
||||||
{"file-lock", 1, 0, 'l'},
|
{"file-lock", 1, 0, 'l'},
|
||||||
{"recursive", 0, 0, 'r'},
|
{"recursive", 0, 0, 'r'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
set_default_options ();
|
set_default_options ();
|
||||||
|
|
||||||
get_runtime_options (&argc, argv, long_options);
|
get_runtime_options (&argc, argv, long_options);
|
||||||
@@ -112,17 +107,17 @@ main (int argc, char **argv)
|
|||||||
config.regex_s = xstrdup (argv[optind]);
|
config.regex_s = xstrdup (argv[optind]);
|
||||||
config.haveregex = 1;
|
config.haveregex = 1;
|
||||||
++optind;
|
++optind;
|
||||||
} /* if */
|
}
|
||||||
|
|
||||||
if (config.haveregex)
|
if (config.haveregex)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBPCRE
|
#ifdef HAVE_LIBPCRE
|
||||||
if (config.perl)
|
if (config.perl)
|
||||||
pcre_init ();
|
pcre_init ();
|
||||||
else
|
else
|
||||||
#endif /* HAVE_LIBPCRE */
|
#endif /* HAVE_LIBPCRE */
|
||||||
regex_init ();
|
regex_init ();
|
||||||
} /* if */
|
}
|
||||||
else
|
else
|
||||||
usage ();
|
usage ();
|
||||||
|
|
||||||
@@ -130,56 +125,49 @@ main (int argc, char **argv)
|
|||||||
singlefile = 1;
|
singlefile = 1;
|
||||||
|
|
||||||
while (optind < argc)
|
while (optind < argc)
|
||||||
/* {{{ */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (config.action == DELETE) {
|
if (config.action == DELETE)
|
||||||
tmpmbox_create (argv[optind]);
|
{
|
||||||
runtime.tmp_mbox = (mbox_t *) mbox_open (config.tmpfilename, "w");
|
tmpmbox_create (argv[optind]);
|
||||||
}
|
runtime.tmp_mbox = (mbox_t *) mbox_open (config.tmpfilename, "w");
|
||||||
|
}
|
||||||
|
|
||||||
config.boxname = xstrdup (argv[optind]);
|
config.boxname = xstrdup (argv[optind]);
|
||||||
|
|
||||||
if (config.recursive)
|
if (config.recursive)
|
||||||
recursive_scan (argv[optind]);
|
recursive_scan (argv[optind]);
|
||||||
else
|
else
|
||||||
scan_mailbox (argv[optind]);
|
scan_mailbox (argv[optind]);
|
||||||
havemailbox = 1;
|
|
||||||
if (config.action == COUNT)
|
|
||||||
{
|
|
||||||
if (singlefile)
|
|
||||||
fprintf (stdout, "%i\n", runtime.count);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (0 == strcmp ("-", argv[optind]))
|
|
||||||
fprintf (stdout, "(standard input):%i\n", runtime.count);
|
|
||||||
else
|
|
||||||
fprintf (stdout, "%s:%i\n", argv[optind], runtime.count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (config.action == DELETE)
|
|
||||||
{
|
|
||||||
mbox_close (runtime.tmp_mbox);
|
|
||||||
rename (config.tmpfilename, argv[optind]);
|
|
||||||
}
|
|
||||||
++optind;
|
|
||||||
} /* while */
|
|
||||||
|
|
||||||
/* }}} */
|
havemailbox = 1;
|
||||||
|
|
||||||
|
if (config.action == COUNT)
|
||||||
|
{
|
||||||
|
if (singlefile)
|
||||||
|
fprintf (stdout, "%i\n", runtime.count);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (0 == strcmp ("-", argv[optind]))
|
||||||
|
fprintf (stdout, "(standard input):%i\n", runtime.count);
|
||||||
|
else
|
||||||
|
fprintf (stdout, "%s:%i\n", argv[optind], runtime.count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (config.action == DELETE)
|
||||||
|
{
|
||||||
|
mbox_close (runtime.tmp_mbox);
|
||||||
|
rename (config.tmpfilename, argv[optind]);
|
||||||
|
}
|
||||||
|
++optind;
|
||||||
|
}
|
||||||
|
|
||||||
if (! havemailbox)
|
if (! havemailbox)
|
||||||
/* {{{ */
|
|
||||||
|
|
||||||
{
|
{
|
||||||
config.format = MBOX;
|
config.format = MBOX;
|
||||||
scan_mailbox ("-");
|
scan_mailbox ("-");
|
||||||
if (config.action == COUNT)
|
if (config.action == COUNT)
|
||||||
fprintf (stdout, "%i\n", runtime.count);
|
fprintf (stdout, "%i\n", runtime.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} /* main */
|
}
|
||||||
|
|
||||||
/* }}} */
|
|
||||||
|
@@ -237,7 +237,7 @@ mbox_read_message (mbox_t * mp)
|
|||||||
char buffer[BUFSIZ];
|
char buffer[BUFSIZ];
|
||||||
message_t *message;
|
message_t *message;
|
||||||
|
|
||||||
message = malloc_message ();
|
message = allocate_message ();
|
||||||
|
|
||||||
s = strlen (mp->postmark_cache);
|
s = strlen (mp->postmark_cache);
|
||||||
message->headers =
|
message->headers =
|
||||||
|
@@ -107,6 +107,7 @@ typedef struct
|
|||||||
int merr;
|
int merr;
|
||||||
int pid;
|
int pid;
|
||||||
int haveregex;
|
int haveregex;
|
||||||
|
int debug;
|
||||||
|
|
||||||
char hostname[HOST_NAME_SIZE];
|
char hostname[HOST_NAME_SIZE];
|
||||||
char *boxname, *outboxname, *pipecmd, *tmpfilename, *regex_s;
|
char *boxname, *outboxname, *pipecmd, *tmpfilename, *regex_s;
|
||||||
|
2
src/mh.c
2
src/mh.c
@@ -87,7 +87,7 @@ message_t *mh_read_message (DIR *dp)
|
|||||||
char buffer[BUFSIZ], *filename;
|
char buffer[BUFSIZ], *filename;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
message = malloc_message ();
|
message = allocate_message ();
|
||||||
|
|
||||||
filename = NULL;
|
filename = NULL;
|
||||||
|
|
||||||
|
253
src/misc.c
253
src/misc.c
@@ -1,6 +1,6 @@
|
|||||||
/* -*- C -*-
|
/*
|
||||||
mboxgrep - scan mailbox for messages matching a regular expression
|
mboxgrep - scan mailbox for messages matching a regular expression
|
||||||
Copyright (C) 2000, 2001, 2002, 2003, 2006 Daniel Spiljar
|
Copyright (C) 2000 - 2004, 2006, 2023 Daniel Spiljar
|
||||||
|
|
||||||
Mboxgrep is free software; you can redistribute it and/or modify it
|
Mboxgrep is free software; you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published by
|
under the terms of the GNU General Public License as published by
|
||||||
@@ -15,8 +15,7 @@
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with mboxgrep; if not, write to the Free Software Foundation,
|
along with mboxgrep; if not, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
$Id: misc.c,v 1.17 2006-07-06 10:53:49 dspiljar Exp $ */
|
|
||||||
|
|
||||||
#define _XOPEN_SOURCE /* Pull in strptime(3) from time.h */
|
#define _XOPEN_SOURCE /* Pull in strptime(3) from time.h */
|
||||||
#define _BSD_SOURCE /* Compensate for _XOPEN_SOURCE to pull in strdup(3)
|
#define _BSD_SOURCE /* Compensate for _XOPEN_SOURCE to pull in strdup(3)
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
|
|
||||||
format_t
|
format_t
|
||||||
folder_format (const char *name)
|
folder_format (const char *name)
|
||||||
/* {{{ */
|
|
||||||
{
|
{
|
||||||
format_t f;
|
format_t f;
|
||||||
|
|
||||||
@@ -63,16 +61,14 @@ folder_format (const char *name)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (config.merr)
|
if (config.merr)
|
||||||
fprintf (stderr, "mboxgrep: %s: unknown folder type\n", name);
|
fprintf (stderr, "%s: %s: unknown folder type\n", APPNAME, name);
|
||||||
exit (2);
|
exit (2);
|
||||||
}
|
}
|
||||||
|
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
lockmethod_t lock_method (const char *name)
|
lockmethod_t lock_method (const char *name)
|
||||||
/* {{{ */
|
|
||||||
{
|
{
|
||||||
lockmethod_t l;
|
lockmethod_t l;
|
||||||
|
|
||||||
@@ -97,38 +93,36 @@ lockmethod_t lock_method (const char *name)
|
|||||||
|
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
/* time_t parse_date(char *datestr) */
|
/*
|
||||||
/* {{{ */
|
time_t parse_date(char *datestr)
|
||||||
/* { */
|
{
|
||||||
/* time_t t; */
|
time_t t;
|
||||||
/* const char *fmt = "%d%n%b%n%Y%n%T"; */
|
const char *fmt = "%d%n%b%n%Y%n%T";
|
||||||
/* int h, m; */
|
int h, m;
|
||||||
/* struct tm tm; */
|
struct tm tm;
|
||||||
/* char *str2, str1[BUFSIZ]; */
|
char *str2, str1[BUFSIZ];
|
||||||
|
|
||||||
/* sscanf (datestr, "Date: %[^\r\n]", str1); */
|
sscanf (datestr, "Date: %[^\r\n]", str1);
|
||||||
|
|
||||||
/* str2 = (char *) strptime (str1, "%d%n%b%n%Y%n%T", &tm); */
|
str2 = (char *) strptime (str1, "%d%n%b%n%Y%n%T", &tm);
|
||||||
/* if (str2 == NULL) */
|
if (str2 == NULL)
|
||||||
/* str2 = (char *) strptime (str1, "%a, %d%n%b%n%Y%n%T", &tm); */
|
str2 = (char *) strptime (str1, "%a, %d%n%b%n%Y%n%T", &tm);
|
||||||
/* if (str2 == NULL) */
|
if (str2 == NULL)
|
||||||
/* return (time_t) 0; */
|
return (time_t) 0;
|
||||||
|
|
||||||
/* if (sscanf (str2, "%3d%2d", &h, &m) == 2) */
|
|
||||||
/* { */
|
|
||||||
/* tm.tm_hour -= h; */
|
|
||||||
/* tm.tm_min -= (h >= 0 ? m : -m); */
|
|
||||||
/* t = (time_t) mktime (&tm); */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
/* return t; */
|
if (sscanf (str2, "%3d%2d", &h, &m) == 2)
|
||||||
/* } */
|
{
|
||||||
/* }}} */
|
tm.tm_hour -= h;
|
||||||
|
tm.tm_min -= (h >= 0 ? m : -m);
|
||||||
|
t = (time_t) mktime (&tm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
char * parse_return_path(char *rpath)
|
char * parse_return_path(char *rpath)
|
||||||
/* {{{ */
|
|
||||||
{
|
{
|
||||||
char *blah1, blah2[BUFSIZ];
|
char *blah1, blah2[BUFSIZ];
|
||||||
|
|
||||||
@@ -137,9 +131,8 @@ char * parse_return_path(char *rpath)
|
|||||||
|
|
||||||
return blah1;
|
return blah1;
|
||||||
}
|
}
|
||||||
/* }}} */
|
|
||||||
|
|
||||||
void * malloc_message (void)
|
void * allocate_message (void)
|
||||||
{
|
{
|
||||||
message_t *message;
|
message_t *message;
|
||||||
|
|
||||||
@@ -188,6 +181,7 @@ set_default_options (void)
|
|||||||
config.format = MBOX; /* default mailbox format */
|
config.format = MBOX; /* default mailbox format */
|
||||||
config.lock = FCNTL; /* default file locking method */
|
config.lock = FCNTL; /* default file locking method */
|
||||||
config.merr = 1; /* report errors by default */
|
config.merr = 1; /* report errors by default */
|
||||||
|
config.debug = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -201,103 +195,104 @@ get_runtime_options (int *argc, char **argv, struct option *long_options)
|
|||||||
&option_index);
|
&option_index);
|
||||||
|
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (c)
|
switch (c)
|
||||||
/* {{{ */
|
{
|
||||||
|
case '?':
|
||||||
{
|
usage();
|
||||||
case '?':
|
case 'c':
|
||||||
usage();
|
config.action = COUNT;
|
||||||
case 'c':
|
break;
|
||||||
config.action = COUNT;
|
case 'd':
|
||||||
break;
|
config.action = DELETE;
|
||||||
case 'd':
|
break;
|
||||||
config.action = DELETE;
|
case 'e':
|
||||||
break;
|
config.regex_s = xstrdup (optarg);
|
||||||
case 'e':
|
config.haveregex = 1;
|
||||||
config.regex_s = xstrdup (optarg);
|
break;
|
||||||
config.haveregex = 1;
|
case 'o':
|
||||||
break;
|
config.outboxname = xstrdup (optarg);
|
||||||
case 'o':
|
config.action = WRITE;
|
||||||
config.outboxname = xstrdup (optarg);
|
break;
|
||||||
config.action = WRITE;
|
case 'E':
|
||||||
break;
|
config.extended = 1;
|
||||||
case 'E':
|
break;
|
||||||
config.extended = 1;
|
case 'G':
|
||||||
break;
|
config.extended = 0;
|
||||||
case 'G':
|
break;
|
||||||
config.extended = 0;
|
case 'P':
|
||||||
break;
|
|
||||||
case 'P':
|
|
||||||
#ifdef HAVE_LIBPCRE
|
#ifdef HAVE_LIBPCRE
|
||||||
config.extended = 0;
|
config.extended = 0;
|
||||||
config.perl = 1;
|
config.perl = 1;
|
||||||
#else
|
#else
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"%s: Support for Perl regular expressions not "
|
"%s: Support for Perl regular expressions not "
|
||||||
"compiled in\n");
|
"compiled in\n", APPNAME);
|
||||||
exit(2);
|
exit(2);
|
||||||
#endif /* HAVE_LIBPCRE */
|
#endif /* HAVE_LIBPCRE */
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
help ();
|
help ();
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
config.ignorecase = 1;
|
config.ignorecase = 1;
|
||||||
break;
|
break;
|
||||||
case 'm':
|
case 'm':
|
||||||
config.format = folder_format (optarg);
|
config.format = folder_format (optarg);
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
config.lock = lock_method (optarg);
|
config.lock = lock_method (optarg);
|
||||||
break;
|
break;
|
||||||
case 'p':
|
case 'p':
|
||||||
config.action = PIPE;
|
config.action = PIPE;
|
||||||
config.pipecmd = xstrdup (optarg);
|
config.pipecmd = xstrdup (optarg);
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
version ();
|
version ();
|
||||||
break;
|
break;
|
||||||
case 'v':
|
case 'v':
|
||||||
config.invert = 1;
|
config.invert = 1;
|
||||||
break;
|
break;
|
||||||
case 'H':
|
case 'H':
|
||||||
config.headers = 1;
|
config.headers = 1;
|
||||||
break;
|
break;
|
||||||
case 'B':
|
case 'B':
|
||||||
config.body = 1;
|
config.body = 1;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
config.merr = 0;
|
config.merr = 0;
|
||||||
break;
|
break;
|
||||||
case 201:
|
case 201:
|
||||||
config.lock = 0;
|
config.lock = 0;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 202:
|
||||||
config.recursive = 1;
|
config.debug = 1;
|
||||||
break;
|
fprintf (stderr, "%s: %s, line %d: enable debugging\n",
|
||||||
case 200:
|
APPNAME, __FILE__, __LINE__);
|
||||||
config.dedup = 1;
|
break;
|
||||||
break;
|
case 'r':
|
||||||
case 'n':
|
config.recursive = 1;
|
||||||
{
|
break;
|
||||||
switch (optarg[0])
|
case 200:
|
||||||
{
|
config.dedup = 1;
|
||||||
case 'd':
|
break;
|
||||||
config.dedup = 1;
|
case 'n':
|
||||||
break;
|
{
|
||||||
case 'l':
|
switch (optarg[0])
|
||||||
config.lock = 0;
|
{
|
||||||
break;
|
case 'd':
|
||||||
default:
|
config.dedup = 1;
|
||||||
fprintf(stderr, "%s: invalid option -- n%c\n",
|
break;
|
||||||
APPNAME, optarg[0]);
|
case 'l':
|
||||||
exit(2);
|
config.lock = 0;
|
||||||
}
|
break;
|
||||||
}
|
default:
|
||||||
} /* switch */
|
fprintf(stderr, "%s: invalid option -- n%c\n",
|
||||||
|
APPNAME, optarg[0]);
|
||||||
/* }}} */
|
exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} /* switch */
|
||||||
} /* while */
|
} /* while */
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ format_t folder_format (const char *name);
|
|||||||
lockmethod_t lock_method (const char *name);
|
lockmethod_t lock_method (const char *name);
|
||||||
/* time_t parse_date(char *datestr); */
|
/* time_t parse_date(char *datestr); */
|
||||||
char * parse_return_path(char *rpath);
|
char * parse_return_path(char *rpath);
|
||||||
void * malloc_message (void);
|
void * allocate_message (void);
|
||||||
void postmark_print (message_t *msg);
|
void postmark_print (message_t *msg);
|
||||||
void set_default_options (void);
|
void set_default_options (void);
|
||||||
void get_runtime_options (int *argc, char **argv, struct option *long_options);
|
void get_runtime_options (int *argc, char **argv, struct option *long_options);
|
||||||
|
4
src/re.c
4
src/re.c
@@ -26,6 +26,7 @@
|
|||||||
#endif /* HAVE_LIBPCRE */
|
#endif /* HAVE_LIBPCRE */
|
||||||
#include "mboxgrep.h"
|
#include "mboxgrep.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
|
#include "wrap.h" /* xcalloc() et cetera */
|
||||||
|
|
||||||
#ifdef HAVE_LIBPCRE
|
#ifdef HAVE_LIBPCRE
|
||||||
void
|
void
|
||||||
@@ -81,7 +82,8 @@ regex_init (void)
|
|||||||
flag1 = REG_ICASE;
|
flag1 = REG_ICASE;
|
||||||
if (config.extended)
|
if (config.extended)
|
||||||
flag2 = REG_EXTENDED;
|
flag2 = REG_EXTENDED;
|
||||||
|
|
||||||
|
config.posix_pattern = (regex_t *) xmalloc (sizeof (regex_t));
|
||||||
errcode = regcomp ((regex_t *) config.posix_pattern, config.regex_s,
|
errcode = regcomp ((regex_t *) config.posix_pattern, config.regex_s,
|
||||||
(flag1 | flag2 | REG_NEWLINE ));
|
(flag1 | flag2 | REG_NEWLINE ));
|
||||||
if (0 != errcode)
|
if (0 != errcode)
|
||||||
|
@@ -42,6 +42,9 @@
|
|||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_LIBZ */
|
||||||
|
#ifdef HAVE_LIBBZ2
|
||||||
|
#include <bzlib.h>
|
||||||
|
#endif /* HAVE_LIBBZ2 */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -108,9 +111,9 @@ FILE *m_fdopen (int fildes, const char *mode)
|
|||||||
|
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
|
|
||||||
gzFile *m_gzdopen (int fildes, const char *mode)
|
gzFile m_gzdopen (int fildes, const char *mode)
|
||||||
{
|
{
|
||||||
gzFile *blah;
|
gzFile blah;
|
||||||
|
|
||||||
blah = gzdopen (fildes, mode);
|
blah = gzdopen (fildes, mode);
|
||||||
if (blah == NULL)
|
if (blah == NULL)
|
||||||
|
@@ -56,7 +56,7 @@ int m_open (const char *pathname, int flags, mode_t mode);
|
|||||||
FILE *m_fopen (const char *path, const char *mode);
|
FILE *m_fopen (const char *path, const char *mode);
|
||||||
FILE *m_fdopen (int fildes, const char *mode);
|
FILE *m_fdopen (int fildes, const char *mode);
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
gzFile *m_gzdopen (int fildes, const char *mode);
|
gzFile m_gzdopen (int fildes, const char *mode);
|
||||||
void gzwrite_loop (void *fp, char *str);
|
void gzwrite_loop (void *fp, char *str);
|
||||||
#endif /* HAVE_LIBZ */
|
#endif /* HAVE_LIBZ */
|
||||||
#ifdef HAVE_LIBBZ2
|
#ifdef HAVE_LIBBZ2
|
||||||
|
Reference in New Issue
Block a user