projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplifications
[apps/madmutt.git]
/
state.c
diff --git
a/state.c
b/state.c
index
715cc9e
..
4e74a7e
100644
(file)
--- a/
state.c
+++ b/
state.c
@@
-6,17
+6,15
@@
* It's licensed under the GNU General Public License,
* please see the file GPL in the top level source directory.
*/
* It's licensed under the GNU General Public License,
* please see the file GPL in the top level source directory.
*/
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <stdlib.h>
-#include <stdio.h>
+#include <lib-lib/lib-lib.h>
+
+#include <lib-mime/rfc3676.h>
#include "mutt.h"
#include "state.h"
#include "mutt.h"
#include "state.h"
-static void state_prefix_put (const char *d, size_t dlen, STATE * s)
+static void state_prefix_put (const char *d, s
s
ize_t dlen, STATE * s)
{
if (s->prefix)
while (dlen--)
{
if (s->prefix)
while (dlen--)
@@
-25,17
+23,17
@@
static void state_prefix_put (const char *d, size_t dlen, STATE * s)
fwrite (d, dlen, 1, s->fpout);
}
fwrite (d, dlen, 1, s->fpout);
}
-void mutt_convert_to_state (iconv_t cd, char *bufi, size_t * l, STATE * s)
+void mutt_convert_to_state (iconv_t cd, char *bufi, s
s
ize_t * l, STATE * s)
{
char bufo[BUFO_SIZE];
{
char bufo[BUFO_SIZE];
-
ICONV_CONST
char *ib;
+
const
char *ib;
char *ob;
char *ob;
- size_t ibl, obl;
+ s
s
ize_t ibl, obl;
if (!bufi) {
if (!bufi) {
- if (cd !=
(iconv_t) (-1)
) {
+ if (cd !=
MUTT_ICONV_ERROR
) {
ob = bufo, obl = sizeof (bufo);
ob = bufo, obl = sizeof (bufo);
-
iconv
(cd, 0, 0, &ob, &obl);
+
my_iconv
(cd, 0, 0, &ob, &obl);
if (ob != bufo)
state_prefix_put (bufo, ob - bufo, s);
}
if (ob != bufo)
state_prefix_put (bufo, ob - bufo, s);
}
@@
-44,7
+42,7
@@
void mutt_convert_to_state (iconv_t cd, char *bufi, size_t * l, STATE * s)
return;
}
return;
}
- if (cd ==
(iconv_t) (-1)
) {
+ if (cd ==
MUTT_ICONV_ERROR
) {
state_prefix_put (bufi, *l, s);
*l = 0;
return;
state_prefix_put (bufi, *l, s);
*l = 0;
return;
@@
-67,11
+65,11
@@
void state_prefix_putc (char c, STATE * s)
if (s->flags & M_PENDINGPREFIX) {
int i;
if (s->flags & M_PENDINGPREFIX) {
int i;
- i =
str_len
(Quotebuf);
+ i =
m_strlen
(Quotebuf);
Quotebuf[i++] = c;
Quotebuf[i] = '\0';
if (i == sizeof (Quotebuf) - 1 || c == '\n') {
Quotebuf[i++] = c;
Quotebuf[i] = '\0';
if (i == sizeof (Quotebuf) - 1 || c == '\n') {
- char buf[2 * S
HORT_S
TRING];
+ char buf[2 * STRING];
int j = 0, offset = 0;
regmatch_t pmatch[1];
int j = 0, offset = 0;
regmatch_t pmatch[1];
@@
-85,12
+83,12
@@
void state_prefix_putc (char c, STATE * s)
buf[0] = '\n';
buf[1] = '\0';
}
buf[0] = '\n';
buf[1] = '\0';
}
- else if (option (OPTQUOTEQUOTED) && offset) {
+ else if (
!option (OPTTEXTFLOWED) &&
option (OPTQUOTEQUOTED) && offset) {
for (i = 0; i < offset; i++)
if (Quotebuf[i] != ' ')
j = i;
for (i = 0; i < offset; i++)
if (Quotebuf[i] != ' ')
j = i;
-
strncpy (buf
, Quotebuf, j + 1);
-
strcpy (buf + j +
1, Quotebuf + j);
+
m_strncpy(buf, sizeof(buf)
, Quotebuf, j + 1);
+
m_strcpy(buf + j + 1, sizeof(buf) - j -
1, Quotebuf + j);
}
else
snprintf (buf, sizeof (buf), "%s%s", NONULL (s->prefix), Quotebuf);
}
else
snprintf (buf, sizeof (buf), "%s%s", NONULL (s->prefix), Quotebuf);
@@
-121,7
+119,7
@@
int state_printf (STATE * s, const char *fmt, ...)
void state_mark_attach (STATE * s)
{
void state_mark_attach (STATE * s)
{
- if ((s->flags & M_DISPLAY) && !
str_cmp
(Pager, "builtin"))
+ if ((s->flags & M_DISPLAY) && !
m_strcmp
(Pager, "builtin"))
state_puts (AttachmentMarker, s);
}
state_puts (AttachmentMarker, s);
}