]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/concat.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / concat.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../mh.h"
9 char *malloc();
10
11 /*VARARGS*/
12 char *concat(args)
13 char *args;
14 {
15 register char **a;
16 register char *cp;
17 register unsigned len;
18 register char *ret;
19
20 len = 1;
21 for(a = &args; *a; )
22 len += strlen(*a++);
23 ret = cp = malloc(len);
24 for(a = &args; *a; )
25 cp = copy(*a++, cp);
26 return(ret);
27 }