Commit 008a27b5 authored by Richard Curnow's avatar Richard Curnow

Corresponds to CVS V0.7

Original rev  : rc@rc0.org.uk--historical/mairix--history--0--patch-11
parent a22da352
NEW IN VERSION 0.7
==================
* Fix bug : mairix likely to crash if a non-existant folder is listed in the
conf file.
* Allow multiple folders and mh_folders lines in the conf file for people who
have many separate folders.
* Print an extra 'comfort' message in verbose mode before starting to scan the
directory tree.
NEW IN VERSION 0.6
==================
......
/*
$Header: /cvs/src/mairix/dirscan.c,v 1.2 2002/07/29 23:03:47 richard Exp $
$Header: /cvs/src/mairix/dirscan.c,v 1.3 2002/11/13 23:46:26 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -241,23 +241,25 @@ static void scan_directory(char *folder_base, char *this_folder, enum folder_typ
sname = new_array(char, this_folder_len + 2 + NAME_MAX);
d = opendir(name);
while ((de = readdir(d))) {
if (!strcmp(de->d_name, ".") ||
!strcmp(de->d_name, "..")) {
continue;
}
if (d) {
while ((de = readdir(d))) {
if (!strcmp(de->d_name, ".") ||
!strcmp(de->d_name, "..")) {
continue;
}
strcpy(fname, name);
strcat(fname, "/");
strcat(fname, de->d_name);
strcpy(fname, name);
strcat(fname, "/");
strcat(fname, de->d_name);
strcpy(sname, this_folder);
strcat(sname, "/");
strcat(sname, de->d_name);
strcpy(sname, this_folder);
strcat(sname, "/");
strcat(sname, de->d_name);
if (stat(fname, &sb) >= 0) {
if (S_ISDIR(sb.st_mode)) {
scan_directory(folder_base, sname, ft, arr);
if (stat(fname, &sb) >= 0) {
if (S_ISDIR(sb.st_mode)) {
scan_directory(folder_base, sname, ft, arr);
}
}
}
}
......
/*
$Header: /cvs/src/mairix/mairix.c,v 1.8 2002/10/03 22:16:56 richard Exp $
$Header: /cvs/src/mairix/mairix.c,v 1.9 2002/11/13 23:47:01 richard Exp $
mairix - message index builder and finder for maildir folders.
......@@ -58,10 +58,31 @@ static char *copy_value(char *text)/*{{{*/
return new_string(p);
}
/*}}}*/
static void add_folders(char **folders, char *extra_folders)/*{{{*/
{
/* note : extra_pointers is stale after this routine exits. */
if (!*folders) {
*folders = extra_folders;
} else {
char *old_folders = *folders;
char *new_folders;
int old_len, extra_len;
old_len = strlen(old_folders);
extra_len = strlen(extra_folders);
new_folders = new_array(char, old_len + extra_len + 2);
strcpy(new_folders, old_folders);
strcpy(new_folders + old_len, ":");
strcpy(new_folders + old_len + 1, extra_folders);
*folders = new_folders;
free(old_folders);
}
}
/*}}}*/
static void parse_rc_file(char *name)/*{{{*/
{
FILE *in;
char line[1024], *p;
char line[4096], *p;
int len, lineno;
int all_blank;
int used_default_name = 0;
......@@ -119,8 +140,8 @@ static void parse_rc_file(char *name)/*{{{*/
/* Now a real line to parse */
if (!strncasecmp(p, "base", 4)) folder_base = copy_value(p);
else if (!strncasecmp(p, "folders", 7)) folders = copy_value(p);
else if (!strncasecmp(p, "mh_folders", 10)) mh_folders = copy_value(p);
else if (!strncasecmp(p, "folders", 7)) add_folders(&folders, copy_value(p));
else if (!strncasecmp(p, "mh_folders", 10)) add_folders(&mh_folders, copy_value(p));
else if (!strncasecmp(p, "vfolder_format", 14)) {
char *temp;
temp = copy_value(p);
......@@ -187,7 +208,7 @@ static int check_message_list_for_duplicates(struct msgpath_array *msgs)/*{{{*/
static char *get_version(void)/*{{{*/
{
static char buffer[256];
static char cvs_version[] = "$Name: V0_5 $";
static char cvs_version[] = "$Name: V0_7 $";
char *p, *q;
for (p=cvs_version; *p; p++) {
if (*p == ':') {
......@@ -392,6 +413,7 @@ int main (int argc, char **argv)/*{{{*/
exit(1);
}
if (verbose) printf("Finding all currently existing messages...\n");
msgs = new_msgpath_array();
if (folders) {
build_message_list(folder_base, folders, FT_MAILDIR, msgs);
......
......@@ -230,7 +230,8 @@ example illustrates:
@example
base=/home/richard/mail
folders=new-mail:new-chrony:new-lojban:new-jbofihe:recent...:ancient...
folders=new-mail:new-chrony:new-lojban:new-jbofihe
folders=recent...:ancient...
mh_folders=an_mh_folder
vfolder=vfolder
vfolder_format=maildir
......@@ -246,10 +247,18 @@ This is the path to the common parent directory of all your maildir folders.
This is a colon-separated list of the Maildir folders (relative to @samp{base})
that you want indexed. Any entry that ends @samp{...} is recursively scanned
to find any Maildir folders underneath it.
More than one line starting with @samp{folders} can be included. In this case,
mairix joins the lines together with colons as though a single list of folders had
been given on a single very long line.
@item mh_folders
This is a colon-separated list of the MH folders (relative to @samp{base}) that
you want indexed. Any entry that ends @samp{...} is recursively scanned to
find any MH folders underneath it.
More than one line starting with @samp{mh_folders} can be included. In this case,
mairix joins the lines together with colons as though a single list of folders had
been given on a single very long line.
@item vfolder
This defines the name of the @emph{virtual} folder (within the directory
specified by @samp{base}) into which the search mode writes its output.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment