]> diplodocus.org Git - nmh/blob - docs/historical/mh-nov-1983/subs/m_setcur.c
Update XOAUTH2 documentation.
[nmh] / docs / historical / mh-nov-1983 / subs / m_setcur.c
1 #include "mh.h"
2 #include <stdio.h>
3
4 struct msgs *mp;
5
6 m_setcur(num)
7 {
8 char buf[6];
9 register int i;
10 register char *cp1;
11
12 if(mp->msgflags&READONLY) {
13 m_replace(cp1 = concat("cur-",mp->foldpath,0), m_name(num));
14 free(cp1);
15 } else {
16 strcpy(buf, m_name(num));
17 cp1 = buf + strlen(buf);
18 *cp1++ = '\n';
19 if(strcmp(current, "cur"))
20 error("\"current\" got Clobbered!! Tell B. Borden");
21 if((i = creat(current, 0660)) >= 0) {
22 write(i, buf, cp1-buf);
23 close(i);
24 }
25 }
26 }