projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
send use m_getfld2
[mmh]
/
uip
/
mhshow.c
diff --git
a/uip/mhshow.c
b/uip/mhshow.c
index
bb03939
..
2a62777
100644
(file)
--- a/
uip/mhshow.c
+++ b/
uip/mhshow.c
@@
-42,6
+42,7
@@
static struct swit switches[] = {
{ NULL, 0 }
};
{ NULL, 0 }
};
+char *version=VERSION;
/* mhparse.c */
extern char *tmp; /* directory to place temp files */
/* mhparse.c */
extern char *tmp; /* directory to place temp files */
@@
-166,7
+167,7
@@
main(int argc, char **argv)
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
adios(EX_USAGE, NULL, "missing argument to %s",
argp[-2]);
if (!(cp = *argp++) || (*cp == '-' && cp[1]))
adios(EX_USAGE, NULL, "missing argument to %s",
argp[-2]);
- file = *cp == '-' ? cp : getcpy(expanddir(cp));
+ file = *cp == '-' ? cp : mh_xstrdup(expanddir(cp));
continue;
case FORMSW:
continue;
case FORMSW:
@@
-174,8
+175,8
@@
main(int argc, char **argv)
adios(EX_USAGE, NULL, "missing argument to %s",
argp[-2]);
if (formsw)
adios(EX_USAGE, NULL, "missing argument to %s",
argp[-2]);
if (formsw)
- free(formsw);
- formsw = getcpy(etcpath(cp));
+ mh_free0(&formsw);
+ formsw = mh_xstrdup(etcpath(cp));
continue;
case VERBSW:
continue;
case VERBSW:
@@
-193,7
+194,7
@@
main(int argc, char **argv)
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
if (folder)
adios(EX_USAGE, NULL, "only one folder at a time!");
else
- folder = getcpy(expandfol(cp));
+ folder = mh_xstrdup(expandfol(cp));
} else if (mode != SHOW) {
adios(EX_USAGE, NULL, "Either call show as `%s' or give message arguments", invo_name);
} else {
} else if (mode != SHOW) {
adios(EX_USAGE, NULL, "Either call show as `%s' or give message arguments", invo_name);
} else {
@@
-240,7
+241,7
@@
main(int argc, char **argv)
if ((cp = context_find(nmhstorage)) && *cp)
tmp = concat(cp, "/", invo_name, NULL);
else
if ((cp = context_find(nmhstorage)) && *cp)
tmp = concat(cp, "/", invo_name, NULL);
else
- tmp = getcpy(toabsdir(invo_name));
+ tmp = mh_xstrdup(toabsdir(invo_name));
if (file && msgs.size)
adios(EX_USAGE, NULL, "cannot specify msg and file at same time!");
if (file && msgs.size)
adios(EX_USAGE, NULL, "cannot specify msg and file at same time!");
@@
-249,7
+250,7
@@
main(int argc, char **argv)
** check if message is coming from file
*/
if (file) {
** check if message is coming from file
*/
if (file) {
- cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts));
+ cts = mh_xcalloc(2, sizeof(*cts));
ctp = cts;
if ((ct = parse_mime(file)))
ctp = cts;
if ((ct = parse_mime(file)))
@@
-300,11
+301,7
@@
main(int argc, char **argv)
if (is_selected(mp, msgnum))
set_unseen(mp, msgnum);
if (is_selected(mp, msgnum))
set_unseen(mp, msgnum);
- seq_setprev(mp); /* set the Previous-Sequence */
- seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */
-
- cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
- sizeof(*cts));
+ cts = mh_xcalloc(mp->numsel + 1, sizeof(*cts));
ctp = cts;
/*
ctp = cts;
/*
@@
-360,11
+357,12
@@
main(int argc, char **argv)
for (ctp = cts; *ctp; ctp++)
free_content(*ctp);
for (ctp = cts; *ctp; ctp++)
free_content(*ctp);
- free((char *) cts);
- cts = NULL;
+ mh_free0(&cts);
/* If reading from a folder, do some updating */
if (mp) {
/* If reading from a folder, do some updating */
if (mp) {
+ seq_read(mp);
+ seq_setunseen(mp, 0); /* unset unseen seqs for shown msgs */
context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->hghsel); /* update current message */
seq_save(mp); /* synchronize sequences */
context_replace(curfolder, folder); /* update current folder */
seq_setcur(mp, mp->hghsel); /* update current message */
seq_save(mp); /* synchronize sequences */