From: markus schnalke Date: Wed, 5 Oct 2011 07:48:37 +0000 (+0200) Subject: Removed configure option --with-hash-prefix and moved backup-prefix to profile X-Git-Tag: mmh-thesis-end~505 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=6c40d481d661d532dd527eaf34cebb6d3f8ed086 Removed configure option --with-hash-prefix and moved backup-prefix to profile --- diff --git a/config/config.c b/config/config.c index 9d961bd..1a7b72f 100644 --- a/config/config.c +++ b/config/config.c @@ -338,6 +338,13 @@ char *whomproc = nmhbindir (/whom); char *sendmail = SENDMAILPATH; /* + * The prefix that is prepended to the name of message files when they + * are "removed" by rmm. This should typically be `,' or `#'. + */ + +char *backup_prefix = ","; + +/* * This is the editor invoked by the various message * composition programs. It SHOULD be a full screen * editor, such as vi or emacs, but any editor will work. diff --git a/configure.ac b/configure.ac index ee28837..274e08d 100644 --- a/configure.ac +++ b/configure.ac @@ -86,17 +86,6 @@ if test -n "$with_editor"; then editorpath="$with_editor" fi -dnl Set the backup prefix -AC_ARG_WITH([hash-backup], - AS_HELP_STRING([--with-hash-backup],[use # as the backup prefix (default: ,)])) -if test x"$with_hash_backup" != x -a x"$with_hash_backup" != x"no"; then - backup_prefix="#" -else - backup_prefix="," -fi -AC_DEFINE_UNQUOTED(BACKUP_PREFIX, "$backup_prefix", - [The prefix that is prepended to the name of message files when they are "removed" by rmm. This should typically be `,' or `#'.])dnl - dnl What method of locking to use? AC_ARG_WITH(locking, AS_HELP_STRING([--with-locking=@<:@dot|fcntl|flock|lockf@:>@], @@ -905,7 +894,6 @@ default editor : ${editorpath} default pager : ${pagerpath} sendmail : ${sendmailpath} -backup prefix : ${backup_prefix} file locking type : ${LOCKTYPE} email address masq. : ${masquerade} " diff --git a/h/mh.h b/h/mh.h index 7442071..31b5f4d 100644 --- a/h/mh.h +++ b/h/mh.h @@ -298,6 +298,7 @@ extern struct node *m_defs; /* list of profile/context entries */ * on any system. */ extern char *buildmimeproc; +extern char *backup_prefix; extern char *catproc; extern char *components; extern char *context; diff --git a/man/mh-profile.man b/man/mh-profile.man index 46c8424..42d1947 100644 --- a/man/mh-profile.man +++ b/man/mh-profile.man @@ -143,6 +143,14 @@ and (profile, default: %default_editor%) .RE .PP +.BR Backup-Prefix : +, +.RS 5 +The prefix that is prepended to the name of message files when they +are "removed" by rmm. This should typically be `,' or `#'. +(profile, default: `,') +.RE +.PP .BR automimeproc : .RS 5 If defined and set to 1, then the diff --git a/sbr/folder_delmsgs.c b/sbr/folder_delmsgs.c index 6bde76f..e6fac04 100644 --- a/sbr/folder_delmsgs.c +++ b/sbr/folder_delmsgs.c @@ -14,7 +14,7 @@ * 2) Else if unlink_msgs is non-zero, then unlink the * SELECTED messages. * 3) Else rename SELECTED messages by prefixing name - * with a standard prefix. + * with backup_prefix. * * If there is an error, return -1, else return 0. */ diff --git a/sbr/folder_read.c b/sbr/folder_read.c index bb88659..d59e731 100644 --- a/sbr/folder_read.c +++ b/sbr/folder_read.c @@ -57,7 +57,7 @@ folder_read (char *name) if (access (name, W_OK) == -1) set_readonly (mp); - prefix_len = strlen(BACKUP_PREFIX); + prefix_len = strlen(backup_prefix); /* * Allocate a temporary place to record the @@ -106,7 +106,7 @@ folder_read (char *name) default: /* skip any files beginning with backup prefix */ - if (!strncmp (dp->d_name, BACKUP_PREFIX, prefix_len)) + if (!strncmp (dp->d_name, backup_prefix, prefix_len)) continue; /* skip the LINK file */ diff --git a/sbr/m_backup.c b/sbr/m_backup.c index c34c409..4159850 100644 --- a/sbr/m_backup.c +++ b/sbr/m_backup.c @@ -18,10 +18,10 @@ m_backup (char *file) if ((cp = r1bindex(file, '/')) == file) snprintf(buffer, sizeof(buffer), "%s%s", - BACKUP_PREFIX, cp); + backup_prefix, cp); else snprintf(buffer, sizeof(buffer), "%.*s%s%s", (int)(cp - file), file, - BACKUP_PREFIX, cp); + backup_prefix, cp); unlink(buffer); return buffer; diff --git a/sbr/readconfig.c b/sbr/readconfig.c index 09cb44d..30585a2 100644 --- a/sbr/readconfig.c +++ b/sbr/readconfig.c @@ -19,6 +19,7 @@ struct procstr { static struct procstr procs[] = { { "context", &context }, { "mh-sequences", &mh_seq }, + { "backup-prefix", &backup_prefix }, { "buildmimeproc", &buildmimeproc }, { "faceproc", &faceproc }, { "fileproc", &fileproc }, diff --git a/uip/mhparam.c b/uip/mhparam.c index 0d5b32c..49c9220 100644 --- a/uip/mhparam.c +++ b/uip/mhparam.c @@ -15,7 +15,6 @@ extern char *mhlibdir; extern char *mhetcdir; -char *sbackup = BACKUP_PREFIX; char *slink = LINK; static struct swit switches[] = { @@ -68,7 +67,7 @@ static struct proc procs [] = { { "whomproc", &whomproc }, { "etcdir", &mhetcdir }, { "libdir", &mhlibdir }, - { "sbackup", &sbackup }, + { "backup-prefix", &backup_prefix }, { "link", &slink }, { NULL, NULL }, }; diff --git a/uip/rmf.c b/uip/rmf.c index a49ba4c..878f22a 100644 --- a/uip/rmf.c +++ b/uip/rmf.c @@ -160,7 +160,7 @@ rmf (char *folder) (void)ext_hook("del-hook", maildir, (char *)0); - j = strlen(BACKUP_PREFIX); + j = strlen(backup_prefix); while ((dp = readdir (dd))) { switch (dp->d_name[0]) { case '.': @@ -182,7 +182,7 @@ rmf (char *folder) if (m_atoi (dp->d_name)) break; if (strcmp (dp->d_name, LINK) == 0 - || strncmp (dp->d_name, BACKUP_PREFIX, j) == 0) + || strncmp (dp->d_name, backup_prefix, j) == 0) break; admonish (NULL, "file \"%s/%s\" not deleted",