projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add some gcc hint defines
[mmh]
/
sbr
/
fmt_compile.c
diff --git
a/sbr/fmt_compile.c
b/sbr/fmt_compile.c
index
28a96e6
..
2b32e71
100644
(file)
--- a/
sbr/fmt_compile.c
+++ b/
sbr/fmt_compile.c
@@
-39,6
+39,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
#include <h/addrsbr.h>
#include <h/tws.h>
#include <h/fmt_scan.h>
#include <h/addrsbr.h>
#include <h/tws.h>
#include <h/fmt_scan.h>
@@
-202,13
+203,14
@@
static struct ftable functable[] = {
{ "mymbox", TF_COMP, FT_LV_COMPFLAG, FT_MYMBOX, TFL_PUTN },
{ "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS},
{ "mymbox", TF_COMP, FT_LV_COMPFLAG, FT_MYMBOX, TFL_PUTN },
{ "unquote", TF_EXPR, FT_LS_UNQUOTE, 0, TFL_PUTS},
+ { "unmailto", TF_EXPR, FT_LS_UNMAILTO, 0, TFL_PUTS},
{ NULL, 0, 0, 0, 0 }
};
/* Add new component to the hash table */
#define NEWCOMP(cm,name) do { \
{ NULL, 0, 0, 0, 0 }
};
/* Add new component to the hash table */
#define NEWCOMP(cm,name) do { \
- cm = ((struct comp *) mh_xcalloc(1, sizeof (struct comp)));\
+ cm = (mh_xcalloc(1, sizeof (struct comp)));\
cm->c_name = name;\
ncomp++;\
i = CHASH(name);\
cm->c_name = name;\
ncomp++;\
i = CHASH(name);\
@@
-307,8
+309,8
@@
fmt_compile(char *fstring, struct format **fmt)
size_t i;
if (format_string)
size_t i;
if (format_string)
- free(format_string);
- format_string = getcpy(fstring);
+ mh_free0(&format_string);
+ format_string = mh_xstrdup(fstring);
usr_fstring = fstring;
/* init the component hash table. */
usr_fstring = fstring;
/* init the component hash table. */
@@
-327,8
+329,7
@@
fmt_compile(char *fstring, struct format **fmt)
i = strlen(fstring)/2 + 1;
if (i == 1)
i++;
i = strlen(fstring)/2 + 1;
if (i == 1)
i++;
- next_fp = formatvec = (struct format *)mh_xcalloc((size_t) i,
- sizeof(struct format));
+ next_fp = formatvec = mh_xcalloc(i, sizeof(struct format));
if (next_fp == NULL)
adios(EX_OSERR, NULL, "unable to allocate format storage");
if (next_fp == NULL)
adios(EX_OSERR, NULL, "unable to allocate format storage");
@@
-479,8
+480,7
@@
do_name(char *sp, int preprocess)
if (cm->c_type & CT_ADDR) {
CERROR("component used as both date and address");
}
if (cm->c_type & CT_ADDR) {
CERROR("component used as both date and address");
}
- cm->c_tws = (struct tws *)
- mh_xcalloc((size_t) 1, sizeof(*cm->c_tws));
+ cm->c_tws = mh_xcalloc(1, sizeof(*cm->c_tws));
fp->f_type = preprocess;
PUTCOMP(sp);
cm->c_type |= CT_DATE;
fp->f_type = preprocess;
PUTCOMP(sp);
cm->c_type |= CT_DATE;