]> diplodocus.org Git - nmh/blob - docs/historical/SRI-NOSC/subs.dir/m_setcur.c
Remove the #ifdef UK for the default scan format
[nmh] / docs / historical / SRI-NOSC / subs.dir / m_setcur.c
1 #include "mh.h"
2
3 char current[];
4 struct msgs *mp;
5
6 m_setcur(num)
7
8 {
9 char buf[6];
10 register int i;
11 register char *cp1;
12
13 if(mp->msgflags&READONLY) {
14 m_replace(cp1 = concat("cur-",mp->foldpath,0), m_name(num));
15 free(cp1);
16 }
17 else {
18 cp1 = copy(m_name(num), buf);
19 *cp1++ = '\n';
20 if(!equal(current, "cur"))
21 error("\"current\" got Clobbered!! Tell B. Borden");
22 if((i = creat(current, 0660)) >= 0) {
23 write(i, buf, cp1-buf);
24 close(i);
25 }
26 }
27 }