> Date: 2026-08-05 14:17:48+0200
> From: Alejandro Colomar <[email protected]>
>
> Hi Kevin,
> 
> > Date: 2026-08-05 11:37:46+0800
> > From: "Kevin J. McCarthy" <[email protected]>
> >
> [...]
> > > > diff --git a/imap/command.c b/imap/command.c
> > > > index 63dedf6c..94c98883 100644
> > > > --- a/imap/command.c
> > > > +++ b/imap/command.c
> > > > @@ -701,7 +701,7 @@ static void cmd_parse_vanished(IMAP_DATA *idata, 
> > > > char *s)
> > > >    end_of_seqset = s;
> > > >    while (*end_of_seqset)
> > > >    {
> > > > -    if (!strchr("0123456789:,", *end_of_seqset))
> > > > +    if (!strchr(CTYPE_DIGIT_C ":,", *end_of_seqset))
> > > 
> > > I wonder if this character set has any name in RFC 7162.  I can't find
> > > it, though.  The only reference to DIGIT seems to be in
> > > mod-sequence-value.
> > 
> > In RFC 7162 there is:
> >    expunged-resp       =  "VANISHED" [SP "(EARLIER)"] SP known-uids
> >    known-uids          =  sequence-set
> >                           ;; Sequence of UIDs; "*" is not allowed.
> > 
> > sequence-set is in RFC 3501:
> >    sequence-set    = (seq-number / seq-range) *("," sequence-set)
> >    seq-range       = seq-number ":" seq-number
> >    seq-number      = nz-number / "*"
> >                -> except note the '*' is not allowed in known-uids
> >    nz-number       = digit-nz *DIGIT
> > 
> > So it's just a sequence of UIDs or UID ranges, each command separated,
> > with '*' disallowed.  Thus this addition of "," and ":".  Is this worth
> > making a special name for?
> 
> Thanks!  I'd make a name for it.  It'd allow us documenting what you
> clarified above, so that it's easier to look up when needed.
> 
> How about this?
> 
>       #define CTYPE_SEQSET_RFC3501_C  CTYPE_DIGIT_C ":," // sequence-set
> 
> I'd document in the commit message that we use it because of RFC7162's
> known-uids.

Self-correction; since '*' is not allowed, it's not really sequence-set.
Let's call it maybe this?:

        #define CTYPE_UIDS_RFC7162_C  CTYPE_DIGIT_C ":,"  // known-uids


Cheers,
Alex

> 
> This name also adds consistency with the surrounding code, which uses'
> 'end_of_seqset'.  I believe that would improve self-explicability of
> this code.
> 
> > > > -static const char safe_chars[] = 
> > > > "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+@{}._-:%";
> > > > +static const char safe_chars[] = CTYPE_PFCHAR_C "+@{}:%";
> > > 
> > > LGTM.  Are those extra safe chars specified by any standard, or is it
> > > just of this project?
> > 
> > Not that I can tell.  It goes way back in the commit log to 986ab5e9.
> 
> Ok.
> 
> > > > +#define CTYPE_PFCHAR_C       CTYPE_ALNUM_C "._-"    // POSIX.1-2008 
> > > > portable
> > > > +                                                    // filename 
> > > > character set
> > > 
> > > Actually, that was already true as of POSIX.1-2001 (Issue 6); the first
> > > modern-day POSIX, where POSIX and SUS (the Single UNIX Specification)
> > > were unified
> > > 
> > > I suspect this was already true way earlier, since I see a reference to
> > > the 'portable filename character set' in XPG Issue 4 (v2) (from which
> > > modern-day POSIX derives).
> > > <https://pubs.opengroup.org/onlinepubs/009656499/toc.pdf#page=423>
> > > I don't see the the definition of the p.f.c.s. in that document, because
> > > it was in a separate volume, and I can't find it.  It's also difficult
> > > to find older standards, unless you know where they are.  :)
> > 
> > Okay, I'll just leave it as "portable filename character set" in the
> > comment then.
> > 
> > > LGTM.
> > 
> > Great.  Thanks Alex!
> 
> Thank you!  :-)
> 
> 
> Have a lovely day!
> Alex
> 
> -- 
> <https://www.alejandro-colomar.es>



-- 
<https://www.alejandro-colomar.es>

Attachment: signature.asc
Description: PGP signature

Reply via email to