Removed configure option --with-hash-prefix and moved backup-prefix to profile
authormarkus schnalke <meillo@marmaro.de>
Wed, 5 Oct 2011 07:48:37 +0000 (09:48 +0200)
committermarkus schnalke <meillo@marmaro.de>
Wed, 5 Oct 2011 07:48:37 +0000 (09:48 +0200)
config/config.c
configure.ac
h/mh.h
man/mh-profile.man
sbr/folder_delmsgs.c
sbr/folder_read.c
sbr/m_backup.c
sbr/readconfig.c
uip/mhparam.c
uip/rmf.c

index 9d961bd..1a7b72f 100644 (file)
@@ -338,6 +338,13 @@ char *whomproc = nmhbindir (/whom);
 char *sendmail = SENDMAILPATH;
 
 /*
 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.
  * 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.
index ee28837..274e08d 100644 (file)
@@ -86,17 +86,6 @@ if test -n "$with_editor"; then
   editorpath="$with_editor"
 fi
 
   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@:>@],
 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}
 
 default pager          : ${pagerpath}
 sendmail               : ${sendmailpath}
 
-backup prefix          : ${backup_prefix}
 file locking type      : ${LOCKTYPE}
 email address masq.    : ${masquerade}
 "
 file locking type      : ${LOCKTYPE}
 email address masq.    : ${masquerade}
 "
diff --git a/h/mh.h b/h/mh.h
index 7442071..31b5f4d 100644 (file)
--- 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;
  * on any system.
  */
 extern char *buildmimeproc;
+extern char *backup_prefix;
 extern char *catproc;
 extern char *components;
 extern char *context;
 extern char *catproc;
 extern char *components;
 extern char *context;
index 46c8424..42d1947 100644 (file)
@@ -143,6 +143,14 @@ and
 (profile, default: %default_editor%)
 .RE
 .PP
 (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
 .BR automimeproc :
 .RS 5
 If defined and set to 1, then the
index 6bde76f..e6fac04 100644 (file)
@@ -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
  * 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.
  */
  *
  * If there is an error, return -1, else return 0.
  */
index bb88659..d59e731 100644 (file)
@@ -57,7 +57,7 @@ folder_read (char *name)
 
     if (access (name, W_OK) == -1)
        set_readonly (mp);
 
     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
 
     /*
      * Allocate a temporary place to record the
@@ -106,7 +106,7 @@ folder_read (char *name)
 
                default: 
                    /* skip any files beginning with backup prefix */
 
                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 */
                        continue;
 
                    /* skip the LINK file */
index c34c409..4159850 100644 (file)
@@ -18,10 +18,10 @@ m_backup (char *file)
 
     if ((cp = r1bindex(file, '/')) == file)
        snprintf(buffer, sizeof(buffer), "%s%s",
 
     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,
     else
        snprintf(buffer, sizeof(buffer), "%.*s%s%s", (int)(cp - file), file,
-               BACKUP_PREFIX, cp);
+               backup_prefix, cp);
 
     unlink(buffer);
     return buffer;
 
     unlink(buffer);
     return buffer;
index 09cb44d..30585a2 100644 (file)
@@ -19,6 +19,7 @@ struct procstr {
 static struct procstr procs[] = {
     { "context",       &context },
     { "mh-sequences",  &mh_seq },
 static struct procstr procs[] = {
     { "context",       &context },
     { "mh-sequences",  &mh_seq },
+    { "backup-prefix", &backup_prefix },
     { "buildmimeproc", &buildmimeproc },
     { "faceproc",      &faceproc },
     { "fileproc",      &fileproc },
     { "buildmimeproc", &buildmimeproc },
     { "faceproc",      &faceproc },
     { "fileproc",      &fileproc },
index 0d5b32c..49c9220 100644 (file)
@@ -15,7 +15,6 @@
 extern char *mhlibdir;
 extern char *mhetcdir;
 
 extern char *mhlibdir;
 extern char *mhetcdir;
 
-char *sbackup = BACKUP_PREFIX;
 char *slink = LINK;
 
 static struct swit switches[] = {
 char *slink = LINK;
 
 static struct swit switches[] = {
@@ -68,7 +67,7 @@ static struct proc procs [] = {
      { "whomproc",      &whomproc },
      { "etcdir",        &mhetcdir },
      { "libdir",        &mhlibdir },
      { "whomproc",      &whomproc },
      { "etcdir",        &mhetcdir },
      { "libdir",        &mhlibdir },
-     { "sbackup",       &sbackup },
+     { "backup-prefix", &backup_prefix },
      { "link",          &slink },
      { NULL,            NULL },
 };
      { "link",          &slink },
      { NULL,            NULL },
 };
index a49ba4c..878f22a 100644 (file)
--- a/uip/rmf.c
+++ b/uip/rmf.c
@@ -160,7 +160,7 @@ rmf (char *folder)
 
     (void)ext_hook("del-hook", maildir, (char *)0);
 
 
     (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 '.': 
     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
                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",
                    break;
 
                admonish (NULL, "file \"%s/%s\" not deleted",