X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fseq_save.c;h=e6f5a5bb6648108ea7624b1bcbdb70917002a04d;hp=0c14f47db41928cc953cebce885b421b7013b67f;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=337338b404931f06f0db2119c9e145e8ca5a9860 diff --git a/sbr/seq_save.c b/sbr/seq_save.c index 0c14f47..e6f5a5b 100644 --- a/sbr/seq_save.c +++ b/sbr/seq_save.c @@ -1,24 +1,24 @@ /* - * seq_save.c -- 1) synchronize sequences - * -- 2) save public sequences - * - * This code is Copyright (c) 2002, by the authors of nmh. See the - * COPYRIGHT file in the root directory of the nmh distribution for - * complete copyright information. - */ +** seq_save.c -- 1) synchronize sequences +** -- 2) save public sequences +** +** This code is Copyright (c) 2002, by the authors of nmh. See the +** COPYRIGHT file in the root directory of the nmh distribution for +** complete copyright information. +*/ #include #include /* - * 1. If sequence is public and folder is readonly, - * then change it to be private - * 2a. If sequence is public, then add it to the sequences file - * in folder (name specified by mh-sequences profile entry). - * 2b. If sequence is private, then add it to the - * context file. - */ +** 1. If sequence is public and folder is readonly, +** then change it to be private +** 2a. If sequence is public, then add it to the sequences file +** in folder (name specified by mh-sequences profile entry). +** 2b. If sequence is private, then add it to the +** context file. +*/ void seq_save (struct msgs *mp) @@ -37,17 +37,19 @@ seq_save (struct msgs *mp) flags = mp->msgflags; /* record folder flags */ /* - * If no mh-sequences file is defined, or if a mh-sequences file - * is defined but empty (*mh_seq == '\0'), then pretend folder - * is readonly. This will force all sequences to be private. - */ + ** If no mh-sequences file is defined, or if a mh-sequences file + ** is defined but empty (*mh_seq == '\0'), then pretend folder + ** is readonly. This will force all sequences to be private. + */ if (mh_seq == NULL || *mh_seq == '\0') set_readonly (mp); else - snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, mh_seq); + snprintf (seqfile, sizeof(seqfile), "%s/%s", mp->foldpath, + mh_seq); for (i = 0; mp->msgattrs[i]; i++) { - snprintf (attr, sizeof(attr), "atr-%s-%s", mp->msgattrs[i], mp->foldpath); + snprintf (attr, sizeof(attr), "atr-%s-%s", mp->msgattrs[i], + mp->foldpath); /* get space separated list of sequence ranges */ if (!(cp = seq_list(mp, mp->msgattrs[i]))) { @@ -57,22 +59,18 @@ seq_save (struct msgs *mp) if (is_readonly(mp) || is_seq_private(mp, i)) { priv: - /* - * sequence is private - */ + /* sequence is private */ context_replace (attr, cp); /* update sequence in context */ } else { - /* - * sequence is public - */ + /* sequence is public */ context_del (attr); /* delete sequence from context */ if (!fp) { /* - * Attempt to open file for public sequences. - * If that fails (probably because folder is - * readonly), then make sequence private. - */ + ** Attempt to open file for public sequences. + ** If that fails (probably because folder is + ** readonly), then make sequence private. + */ if ((fp = lkfopen (seqfile, "w")) == NULL && (unlink (seqfile) == -1 || (fp = lkfopen (seqfile, "w")) == NULL)) { @@ -97,16 +95,16 @@ priv: SIGPROCMASK (SIG_SETMASK, &oset, &set); /* reset signal mask */ } else { /* - * If folder is not readonly, and we didn't save any - * public sequences, then remove that file. - */ + ** If folder is not readonly, and we didn't save any + ** public sequences, then remove that file. + */ if (!is_readonly(mp)) unlink (seqfile); } /* - * Reset folder flag, since we may be - * pretending that folder is readonly. - */ + ** Reset folder flag, since we may be + ** pretending that folder is readonly. + */ mp->msgflags = flags; }