#endif
#include "mutt.h"
+#include "handler.h"
#include "pgp.h"
#include "pgppacket.h"
-#include "mime.h"
#include "charset.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
+#include <lib-lib/file.h>
+
+#include <lib-mime/mime.h>
+
#include "lib/debug.h"
static struct {
static void pgp_dearmor (FILE * in, FILE * out)
{
char line[HUGE_STRING];
- long start;
- long end;
+ off_t start;
+ off_t end;
char *r;
STATE state;
- memset (&state, 0, sizeof (STATE));
+ p_clear(&state, 1);
state.fpin = in;
state.fpout = out;
/* skip the armor header */
while ((r = fgets (line, sizeof (line), in)) != NULL) {
- SKIPWS (r);
+ r = vskipspaces(r);
if (!*r)
break;
}
}
/* actual data starts here */
- start = ftell (in);
+ start = ftello (in);
/* find the checksum */
return;
}
- if ((end = ftell (in) - mutt_strlen (line)) < start) {
+ if ((end = ftello (in) - m_strlen(line)) < start) {
debug_print (1, ("end < start???\n"));
return;
}
- if (fseek (in, start, SEEK_SET) == -1) {
+ if (fseeko (in, start, SEEK_SET) == -1) {
debug_print (1, ("Can't seekto start.\n"));
return;
}