projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nico Golde:
[apps/madmutt.git]
/
edit.c
diff --git
a/edit.c
b/edit.c
index
d3818f6
..
d9a667a
100644
(file)
--- a/
edit.c
+++ b/
edit.c
@@
-14,6
+14,8
@@
#endif
#include "mutt.h"
#endif
#include "mutt.h"
+#include "ascii.h"
+#include "enter.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
#include "mutt_curses.h"
#include "mutt_idna.h"
@@
-63,7
+65,7
@@
static char **be_snarf_data (FILE * f, char **buf, int *bufmax, int *buflen,
tmp[sizeof (tmp) - 1] = 0;
if (prefix) {
strfcpy (tmp, NONULL (Prefix), sizeof (tmp));
tmp[sizeof (tmp) - 1] = 0;
if (prefix) {
strfcpy (tmp, NONULL (Prefix), sizeof (tmp));
- tmplen =
mutt_str
len (tmp);
+ tmplen =
str_
len (tmp);
p = tmp + tmplen;
tmplen = sizeof (tmp) - tmplen;
}
p = tmp + tmplen;
tmplen = sizeof (tmp) - tmplen;
}
@@
-72,13
+74,13
@@
static char **be_snarf_data (FILE * f, char **buf, int *bufmax, int *buflen,
while (bytes > 0) {
if (fgets (p, tmplen - 1, f) == NULL)
break;
while (bytes > 0) {
if (fgets (p, tmplen - 1, f) == NULL)
break;
- bytes -=
mutt_str
len (p);
+ bytes -=
str_
len (p);
if (*bufmax == *buflen)
if (*bufmax == *buflen)
-
safe
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = s
afe_str
dup (tmp);
+
mem
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
+ buf[(*buflen)++] = s
tr_
dup (tmp);
}
if (buf && *bufmax == *buflen) { /* Do not smash memory past buf */
}
if (buf && *bufmax == *buflen) { /* Do not smash memory past buf */
-
safe
_realloc (&buf, sizeof (char *) * (++*bufmax));
+
mem
_realloc (&buf, sizeof (char *) * (++*bufmax));
}
if (buf)
buf[*buflen] = NULL;
}
if (buf)
buf[*buflen] = NULL;
@@
-130,9
+132,9
@@
static int be_barf_file (const char *path, char **buf, int buflen)
static void be_free_memory (char **buf, int buflen)
{
while (buflen-- > 0)
static void be_free_memory (char **buf, int buflen)
{
while (buflen-- > 0)
-
FREE
(&buf[buflen]);
+
mem_free
(&buf[buflen]);
if (buf)
if (buf)
-
FREE
(&buf);
+
mem_free
(&buf);
}
static char **be_include_messages (char *msg, char **buf, int *bufmax,
}
static char **be_include_messages (char *msg, char **buf, int *bufmax,
@@
-154,8
+156,8
@@
static char **be_include_messages (char *msg, char **buf, int *bufmax,
}
if (*bufmax == *buflen)
}
if (*bufmax == *buflen)
-
safe
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = s
afe_str
dup (tmp);
+
mem
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
+ buf[(*buflen)++] = s
tr_
dup (tmp);
bytes = Context->hdrs[n]->content->length;
if (inc_hdrs) {
bytes = Context->hdrs[n]->content->length;
if (inc_hdrs) {
@@
-168,8
+170,8
@@
static char **be_include_messages (char *msg, char **buf, int *bufmax,
pfx);
if (*bufmax == *buflen)
pfx);
if (*bufmax == *buflen)
-
safe
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
- buf[(*buflen)++] = s
afe_str
dup ("\n");
+
mem
_realloc (&buf, sizeof (char *) * (*bufmax += 25));
+ buf[(*buflen)++] = s
tr_
dup ("\n");
}
else
printw (_("%d: invalid message number.\n"), n);
}
else
printw (_("%d: invalid message number.\n"), n);
@@
-316,7
+318,7
@@
int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur)
if (EscChar && tmp[0] == EscChar[0] && tmp[1] != EscChar[0]) {
/* remove trailing whitespace from the line */
if (EscChar && tmp[0] == EscChar[0] && tmp[1] != EscChar[0]) {
/* remove trailing whitespace from the line */
- p = tmp +
mutt_str
len (tmp) - 1;
+ p = tmp +
str_
len (tmp) - 1;
while (p >= tmp && ISSPACE (*p))
*p-- = 0;
while (p >= tmp && ISSPACE (*p))
*p-- = 0;
@@
-345,9
+347,9
@@
int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur)
if (Context) {
if (!*p && cur) {
/* include the current message */
if (Context) {
if (!*p && cur) {
/* include the current message */
- p = tmp +
mutt_str
len (tmp) + 1;
- snprintf (tmp +
mutt_str
len (tmp),
- sizeof (tmp) -
mutt_str
len (tmp), " %d",
+ p = tmp +
str_
len (tmp) + 1;
+ snprintf (tmp +
str_
len (tmp),
+ sizeof (tmp) -
str_
len (tmp), " %d",
cur->msgno + 1);
}
buf = be_include_messages (p, buf, &bufmax, &buflen,
cur->msgno + 1);
}
buf = be_include_messages (p, buf, &bufmax, &buflen,
@@
-389,8
+391,8
@@
int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur)
if (buflen) {
buflen--;
strfcpy (tmp, buf[buflen], sizeof (tmp));
if (buflen) {
buflen--;
strfcpy (tmp, buf[buflen], sizeof (tmp));
- tmp[
mutt_str
len (tmp) - 1] = 0;
-
FREE
(&buf[buflen]);
+ tmp[
str_
len (tmp) - 1] = 0;
+
mem_free
(&buf[buflen]);
buf[buflen] = NULL;
continue;
}
buf[buflen] = NULL;
continue;
}
@@
-433,13
+435,13
@@
int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur)
break;
}
}
break;
}
}
- else if (
mutt_str
cmp (".", tmp) == 0)
+ else if (
str_
cmp (".", tmp) == 0)
done = 1;
else {
done = 1;
else {
- s
afe_str
cat (tmp, sizeof (tmp), "\n");
+ s
tr_
cat (tmp, sizeof (tmp), "\n");
if (buflen == bufmax)
if (buflen == bufmax)
-
safe
_realloc (&buf, sizeof (char *) * (bufmax += 25));
- buf[buflen++] = s
afe_str
dup (tmp[1] == '~' ? tmp + 1 : tmp);
+
mem
_realloc (&buf, sizeof (char *) * (bufmax += 25));
+ buf[buflen++] = s
tr_
dup (tmp[1] == '~' ? tmp + 1 : tmp);
}
tmp[0] = 0;
}
tmp[0] = 0;