]> git.marmaro.de Git - mmh/commitdiff
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 9d961bdb59954c71eecabf51e13d8f8eea2f173e..1a7b72f6f9ced53b6c38bb06e5d1d1cd2eceae8b 100644 (file)
@@ -337,6 +337,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
index ee288373e32c3d3623af6f4023d3960ee0769f0e..274e08d2e2cda0bba22361aefdd2f266bc81d8a3 100644 (file)
@@ -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 7442071f855f87ee18e590bf1b9f3decb892791f..31b5f4d868cb6505c05d800a48db5834e907f3a5 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;
+extern char *backup_prefix;
 extern char *catproc;
 extern char *components;
 extern char *context;
index 46c8424f7117172c6f9d6ff126c4ba932cd5f984..42d1947393c5723b812cf1e5e9f4451200555f96 100644 (file)
@@ -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
index 6bde76f9349b2c97a5cc5d43166404296cc78e13..e6fac04fde08a880dc376cee351719cb7a1ef167 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
- *    with a standard prefix.
+ *    with backup_prefix.
  *
  * If there is an error, return -1, else return 0.
  */
index bb88659824805f138c3d68605cbf658de64db2e3..d59e7310da81517c3ec9ca224ed91d170927e244 100644 (file)
@@ -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 */
index c34c40974343f1b92e0de5c685090d916f05fc38..41598507ba9cd68c2b58d0d8e2f8d2110a28d7c0 100644 (file)
@@ -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;
index 09cb44dedb86c12a7ebb4784fe5d90a97199ce41..30585a231b3a4a302cac710a12fa9a12b7be0cbc 100644 (file)
@@ -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 },
index 0d5b32c85e83b057afb33b3f0d4e6ad425a1a32a..49c9220a2529b2a2de1aaa4c40f1b3a923d3a708 100644 (file)
@@ -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 },
 };
index a49ba4cf8d24801562821dc89fad1e98a9e4485d..878f22ad13efaf3385022a009bccd3d8d8cc4c08 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);
 
-    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",