* allow mimepart identifiers to be alphanumeric, as claimed by Sam
authorWilfried Göesgens <willi@citadel.org>
Fri, 12 Jun 2009 06:46:35 +0000 (06:46 +0000)
committerWilfried Göesgens <willi@citadel.org>
Fri, 12 Jun 2009 06:46:35 +0000 (06:46 +0000)
webcit/messages.c

index da9797e55740622997e1c352e385ef934ba4ab22..e67642d823ffed6e1c1f86dfaa8e39b47ff75d87 100644 (file)
@@ -1740,18 +1740,19 @@ void postpart(StrBuf *partnum, StrBuf *filename, int force_download)
  */
 void mimepart(int force_download)
 {
-       long msgnum, att;
+       long msgnum;
+       StrBuf *att;
        wcsession *WCC = WC;
        StrBuf *Buf;
        off_t bytes;
        StrBuf *ContentType = NewStrBufPlain(HKEY("application/octet-stream"));
        const char *CT;
 
+       att = Buf = NewStrBuf();
        msgnum = StrBufExtract_long(WCC->Hdr->HR.ReqLine, 0, '/');
-       att = StrBufExtract_long(WCC->Hdr->HR.ReqLine, 1, '/');
+       StrBufExtract_token(att, WCC->Hdr->HR.ReqLine, 1, '/');
 
-       Buf = NewStrBuf();
-       serv_printf("OPNA %ld|%ld", msgnum, att);
+       serv_printf("OPNA %ld|%s", msgnum, ChrPtr(att));
        StrBuf_ServGetln(Buf);
        if (GetServerStatus(Buf, NULL) == 2) {
                StrBufCutLeft(Buf, 4);