projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix regression, propably due to some changes in the string API
[apps/madmutt.git]
/
pager.c
diff --git
a/pager.c
b/pager.c
index
8b98c73
..
13f3908
100644
(file)
--- a/
pager.c
+++ b/
pager.c
@@
-16,6
+16,7
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
#include <lib-lib/macros.h>
#include "mutt.h"
#include <lib-lib/macros.h>
#include "mutt.h"
@@
-40,7
+41,6
@@
#include "mutt_crypt.h"
#include "mutt_crypt.h"
-#include "lib/str.h"
#include "lib/rx.h"
#include "lib/debug.h"
#include "lib/rx.h"
#include "lib/debug.h"
@@
-687,8
+687,8
@@
resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last,
else if (check_attachment_marker ((char *) raw) == 0)
lineInfo[n].type = MT_COLOR_ATTACHMENT;
#endif
else if (check_attachment_marker ((char *) raw) == 0)
lineInfo[n].type = MT_COLOR_ATTACHMENT;
#endif
- else if (
str_cmp
("-- \n", buf) == 0
- ||
str_cmp
("-- \r\n", buf) == 0) {
+ else if (
m_strcmp
("-- \n", buf) == 0
+ ||
m_strcmp
("-- \r\n", buf) == 0) {
i = n + 1;
lineInfo[n].type = MT_COLOR_SIGNATURE;
i = n + 1;
lineInfo[n].type = MT_COLOR_SIGNATURE;
@@
-887,7
+887,7
@@
static int trim_incomplete_mbyte(unsigned char *buf, size_t len) {
mbstate_t mbstate;
size_t k;
mbstate_t mbstate;
size_t k;
-
memset (&mbstate, 0, sizeof (mbstate)
);
+
p_clear(&mbstate, 1
);
for (; len > 0; buf += k, len -= k) {
k = mbrtowc (NULL, (char *) buf, len, &mbstate);
if (k == -2)
for (; len > 0; buf += k, len -= k) {
k = mbrtowc (NULL, (char *) buf, len, &mbstate);
if (k == -2)
@@
-981,7
+981,7
@@
static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
wrap_cols = COLS;
/* FIXME: this should come from lineInfo */
wrap_cols = COLS;
/* FIXME: this should come from lineInfo */
-
memset (&mbstate, 0, sizeof (mbstate)
);
+
p_clear(&mbstate, 1
);
for (ch = 0, vch = 0; ch < cnt; ch += k, vch += k) {
/* Handle ANSI sequences */
for (ch = 0, vch = 0; ch < cnt; ch += k, vch += k) {
/* Handle ANSI sequences */
@@
-1146,7
+1146,7
@@
display_line (FILE * f, off_t *last_pos, struct line_t **lineInfo, int n,
if (*last == *max) {
p_realloc(lineInfo, *max += LINES);
for (ch = *last; ch < *max; ch++) {
if (*last == *max) {
p_realloc(lineInfo, *max += LINES);
for (ch = *last; ch < *max; ch++) {
-
memset (&((*lineInfo)[ch]), 0, sizeof (struct line_t)
);
+
p_clear(&(*lineInfo)[ch], 1
);
(*lineInfo)[ch].type = -1;
(*lineInfo)[ch].search_cnt = -1;
(*lineInfo)[ch].syntax = p_new(struct syntax_t, 1);
(*lineInfo)[ch].type = -1;
(*lineInfo)[ch].search_cnt = -1;
(*lineInfo)[ch].syntax = p_new(struct syntax_t, 1);
@@
-1462,7
+1462,7
@@
mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
lineInfo = p_new(struct line_t, maxLine = LINES);
for (i = 0; i < maxLine; i++) {
lineInfo = p_new(struct line_t, maxLine = LINES);
for (i = 0; i < maxLine; i++) {
-
memset (&lineInfo[i], 0, sizeof (struct line_t)
);
+
p_clear(&lineInfo[i], 1
);
lineInfo[i].type = -1;
lineInfo[i].search_cnt = -1;
lineInfo[i].syntax = p_new(struct syntax_t, 1);
lineInfo[i].type = -1;
lineInfo[i].search_cnt = -1;
lineInfo[i].syntax = p_new(struct syntax_t, 1);