2 * Citadel/UX message support routines
3 * see copyright.txt for copyright information
10 #include <sys/types.h>
31 #define MAXWORDBUF 256
36 char text[MAXWORDBUF];
39 void sttybbs(int cmd);
40 int struncmp(char *lstr, char *rstr, int len);
41 int fmout(int width, FILE *fp, char pagin, int height, int starting_lp, char subst);
42 int haschar(char *st, int ch);
43 int checkpagin(int lp, int pagin, int height);
44 void getline(char *string, int lim);
45 void formout(char *name);
47 void newprompt(char *prompt, char *str, int len);
48 int file_checksum(char *filename);
49 void do_edit(char *desc, char *read_cmd, char *check_cmd, char *write_cmd);
52 long msg_arr[MAXMSGS];
54 extern char room_name[];
55 extern unsigned room_flags;
56 extern long highest_msg_read;
57 extern struct CtdlServInfo serv_info;
60 extern int screenwidth;
61 extern int screenheight;
62 extern long maxmsgnum;
65 extern char is_room_aide;
66 extern char fullname[];
68 extern unsigned userflags;
69 extern char sigcaught;
70 extern char editor_path[];
71 extern char printcmd[];
72 extern int rc_allow_attachments;
73 extern int rc_display_message_numbers;
74 extern int rc_force_mail_prompts;
76 extern int editor_pid;
80 void ka_sigcatch(int signum) {
83 signal(SIGALRM, ka_sigcatch);
90 * server keep-alive version of wait() (needed for external editor)
92 pid_t ka_wait(int *kstatus)
97 signal(SIGALRM, ka_sigcatch);
101 } while (errno==EINTR);
102 signal(SIGALRM,SIG_IGN);
109 * version of system() that uses ka_wait()
111 int ka_system(char *shc)
120 perror("Cannot fork");
122 return((pid_t)childpid);
126 execlp("/bin/sh","sh","-c",shc,NULL);
132 waitpid = ka_wait(&retcode);
133 } while (waitpid != childpid);
143 * add a newline to the buffer...
145 void add_newline(struct cittext *textlist)
150 while (ptr->next != NULL) ptr = ptr->next;
152 while (ptr->text[strlen(ptr->text)-1]==32)
153 ptr->text[strlen(ptr->text)-1] = 0;
154 /* strcat(ptr->text,"\n"); */
156 ptr->next = (struct cittext *)
157 malloc(sizeof(struct cittext));
160 strcpy(ptr->text,"");
165 * add a word to the buffer...
167 void add_word(struct cittext *textlist, char *wordbuf)
173 while (ptr->next != NULL) ptr = ptr->next;
175 if (3+strlen(ptr->text)+strlen(wordbuf) > screenwidth) {
176 ptr->next = (struct cittext *)
177 malloc(sizeof(struct cittext));
180 strcpy(ptr->text,"");
183 strcat(ptr->text,wordbuf);
184 strcat(ptr->text," ");
189 * begin editing of an opened file pointed to by fp, beginning at position pos.
191 void citedit(FILE *fp, long int base_pos)
193 int a,prev,finished,b,last_space;
195 struct cittext *textlist = NULL;
197 char wordbuf[MAXWORDBUF];
199 time_t last_server_msg,now;
202 * we're going to keep track of the last time we talked to
203 * the server, so we can periodically send keep-alive messages
204 * out so it doesn't time out.
206 time(&last_server_msg);
208 /* first, load the text into the buffer */
209 fseek(fp,base_pos,0);
210 textlist = (struct cittext *)malloc(sizeof(struct cittext));
211 textlist->next = NULL;
212 strcpy(textlist->text,"");
216 while (a=getc(fp), a>=0) {
218 if ((a==32)||(a==9)||(a==13)||(a==10)) {
219 add_word(textlist,wordbuf);
221 if ((prev==13)||(prev==10)) {
222 add_word(textlist,"\n");
223 add_newline(textlist);
224 add_word(textlist,"");
228 wordbuf[strlen(wordbuf)+1] = 0;
229 wordbuf[strlen(wordbuf)] = a;
231 if (strlen(wordbuf)+3 > screenwidth) {
232 add_word(textlist,wordbuf);
240 prev = (appending ? 13 : (-1));
247 if ((a==32)&&(prev==13)) {
248 add_word(textlist,"\n");
249 add_newline(textlist);
252 if (strlen(wordbuf)>0) {
253 wordbuf[strlen(wordbuf)-1] = 0;
261 if (strlen(wordbuf)==0) finished = 1;
263 for (b=0; b<strlen(wordbuf); ++b)
264 if (wordbuf[b]==32) {
266 add_word(textlist,wordbuf);
267 strcpy(wordbuf,&wordbuf[b+1]);
270 add_word(textlist,wordbuf);
276 wordbuf[strlen(wordbuf)+1] = 0;
277 wordbuf[strlen(wordbuf)] = a;
279 if ((strlen(wordbuf)+3) > screenwidth) {
281 for (b=0; b<strlen(wordbuf); ++b)
282 if (wordbuf[b]==32) last_space = b;
284 for (b=0; b<strlen(wordbuf); ++b)
285 if (wordbuf[b]==32) {
287 add_word(textlist,wordbuf);
288 strcpy(wordbuf,&wordbuf[b+1]);
291 for (b=0; b<strlen(wordbuf); ++b) {
296 printf("\n%s",wordbuf);
299 add_word(textlist,wordbuf);
306 /* this check implements the server keep-alive */
308 if ( (now - last_server_msg) > S_KEEPALIVE ) {
311 last_server_msg = now;
314 } while (finished==0);
316 /* write the buffer back to disk */
317 fseek(fp,base_pos,0);
318 for (ptr=textlist; ptr!=NULL; ptr=ptr->next) {
319 fprintf(fp,"%s",ptr->text);
324 /* and deallocate the memory we used */
325 while (textlist!=NULL) {
333 int read_message(long int num, char pagin) /* Read a message from the server */
335 /* 0 = normal read, 1 = read with pagination, 2 = header */
349 sprintf(buf,"MSG0 %ld|%d",num,(pagin==READ_HEADER ? 1 : 0));
353 printf("*** msg #%ld: %s\n",num,buf);
355 lines_printed = checkpagin(lines_printed,pagin,screenheight);
360 strcpy(m_subject,"");
363 lines_printed = checkpagin(lines_printed,pagin,screenheight);
365 if (pagin == 1) color(BRIGHT_CYAN);
368 while(serv_gets(buf), strcmp(buf,"000")) {
373 checkpagin(lines_printed,
381 strcpy(reply_to,"nobody...xxxxx");
382 while(serv_gets(buf), struncmp(buf,"text",4)) {
383 if (!struncmp(buf,"nhdr=yes",8)) nhdr=1;
384 if (!struncmp(buf,"from=",5)) {
385 strcpy(from,&buf[5]);
387 if (nhdr==1) buf[0]='_';
388 if (!struncmp(buf,"type=",5))
389 format_type=atoi(&buf[5]);
390 if ((!struncmp(buf,"msgn=",5))&&(rc_display_message_numbers)) {
394 printf("#%s",&buf[5]);
398 if (!struncmp(buf,"from=",5)) {
402 printf("%s ",&buf[5]);
404 if (!struncmp(buf,"subj=",5))
405 strcpy(m_subject,&buf[5]);
406 if ((!struncmp(buf,"hnod=",5))
407 && (strucmp(&buf[5],serv_info.serv_humannode))) {
411 printf("%s",&buf[5]);
415 if ((!struncmp(buf,"room=",5))
416 && (strucmp(&buf[5],room_name))) {
419 color(BRIGHT_MAGENTA);
420 printf("%s> ",&buf[5]);
423 if (!struncmp(buf,"node=",5)) {
424 if ( (room_flags&QR_NETWORK)
425 || ((strucmp(&buf[5],serv_info.serv_nodename)
426 &&(strucmp(&buf[5],serv_info.serv_fqdn)))))
430 color(BRIGHT_YELLOW);
431 printf("%s ",&buf[5]);
433 if ((!strucmp(&buf[5],serv_info.serv_nodename))
434 ||(!strucmp(&buf[5],serv_info.serv_fqdn)))
436 strcpy(reply_to,from);
439 sprintf(reply_to,"%s @ %s",from,&buf[5]);
443 if (!struncmp(buf,"rcpt=",5)) {
447 printf("%s ",&buf[5]);
449 if (!struncmp(buf,"time=",5)) {
451 tm=(struct tm *)localtime(&now);
452 strcpy(buf,asctime(tm)); buf[strlen(buf)-1]=0;
453 strcpy(&buf[16],&buf[19]);
454 color(BRIGHT_MAGENTA);
455 printf("%s ",&buf[4]);
468 if (pagin == 1) color(BRIGHT_WHITE);
470 lines_printed = checkpagin(lines_printed,pagin,screenheight);
472 if (strlen(m_subject)>0) {
473 printf("Subject: %s\n",m_subject);
475 lines_printed = checkpagin(lines_printed,pagin,screenheight);
478 if (format_type == 0) {
479 fr=fmout(screenwidth,NULL,
480 ((pagin==1) ? 1 : 0),
481 screenheight,(-1),1);
484 while(serv_gets(buf), strcmp(buf,"000")) {
487 lines_printed = lines_printed + 1 +
488 (strlen(buf)/screenwidth);
490 checkpagin(lines_printed,pagin,screenheight);
497 lines_printed = checkpagin(lines_printed,pagin,screenheight);
499 if (pagin == 1) color(DIM_WHITE);
505 * replace string function for the built-in editor
507 void replace_string(char *filename, long int startpos)
516 int substitutions = 0;
519 printf("Enter text to be replaced:\n: ");
520 getline(srch_str,128);
521 if (strlen(srch_str)==0) return;
523 printf("Enter text to replace it with:\n: ");
524 getline(rplc_str,128);
526 fp=fopen(filename,"r+");
527 if (fp==NULL) return;
530 fseek(fp,startpos,0);
532 while (a=getc(fp), a>0) {
534 buf[strlen(buf)+1] = 0;
535 buf[strlen(buf)] = a;
536 if ( strlen(buf) >= strlen(srch_str) ) {
537 ptr=&buf[strlen(buf)-strlen(srch_str)];
538 if (!struncmp(ptr,srch_str,strlen(srch_str))) {
539 strcpy(ptr,rplc_str);
543 if (strlen(buf)>384) {
546 fwrite((char *)buf,128,1,fp);
547 strcpy(buf,&buf[128]);
553 if (strlen(buf)>0) fwrite((char *)buf,strlen(buf),1,fp);
556 printf("<R>eplace made %d substitution(s).\n\n",substitutions);
560 int make_message(char *filename, char *recipient, int anon_type, int format_type, int mode)
561 /* temporary file name */
562 /* NULL if it's not mail */
563 /* see MES_ types in header file */
574 if (mode==2) if (strlen(editor_path)==0) {
575 printf("*** No editor available, using built-in editor\n");
580 strcpy(datestr,asctime(localtime(&now)));
581 datestr[strlen(datestr)-1] = 0;
583 if (room_flags & QR_ANONONLY) {
587 printf(" %s from %s",datestr,fullname);
588 if (strlen(recipient)>0) printf(" to %s",recipient);
594 if (mode==1) printf("(Press ctrl-d when finished)\n");
596 fp=fopen(filename,"r");
598 fmout(screenwidth,fp,0,screenheight,0,0);
603 fp=fopen(filename,"w");
611 fp=fopen(filename,"r+");
617 fp=fopen(filename,"w");
619 a=inkey(); if (a==255) a=32;
625 if (a==10) putc(13,stdout);
631 e_ex_code = 1; /* start with a failed exit code */
633 cksum = file_checksum(filename);
635 chmod(filename,0600);
637 execlp(editor_path,editor_path,filename,NULL);
640 if (editor_pid>0) do {
642 b=ka_wait(&e_ex_code);
643 } while((b!=editor_pid)&&(b>=0));
650 if (file_checksum(filename) == cksum) {
651 printf("*** Aborted message.\n");
654 if (e_ex_code==0) goto MEFIN;
657 MECR1: printf("Entry cmd (? for options) -> ");
659 if (b==NEXT_KEY) b='n';
660 if (b==STOP_KEY) b='s';
661 b=(b&127); b=tolower(b);
667 if (b=='a') { printf("Abort\n"); goto MEABT; }
668 if (b=='c') { printf("Continue\n"); goto ME1; }
669 if (b=='s') { printf("Save message\n"); goto MEFIN; }
671 printf("Print formatted\n");
672 printf(" %s from %s",datestr,fullname);
673 if (strlen(recipient)>0) printf(" to %s",recipient);
675 fp=fopen(filename,"r");
677 fmout(screenwidth,fp,
678 ((userflags & US_PAGINATOR) ? 1 : 0),
686 printf("Replace string\n");
687 replace_string(filename,0L);
691 printf("Hold message\n");
698 MEABT: printf("Are you sure? ");
699 if (yesno()==0) goto ME1;
700 MEABT2: unlink(filename);
705 * transmit message text to the server
707 void transmit_message(FILE *fp)
714 fseek(fp, 0L, SEEK_END);
717 lasttick = time(NULL);
719 while (ch=getc(fp), (ch>=0)) {
721 if (!strcmp(buf,"000")) strcpy(buf,">000");
729 if ((ch==32)&&(strlen(buf)>200)) {
731 if (!strcmp(buf,"000")) strcpy(buf,">000");
735 if (strlen(buf)>250) {
736 if (!strcmp(buf,"000")) strcpy(buf,">000");
742 if ( (time(NULL) - lasttick) > 2L ) {
743 printf(" %3ld%% completed\r",
744 ((ftell(fp) * 100L) / msglen) );
746 lasttick = time(NULL);
758 * entmsg() - edit and create a message
759 * returns 0 if message was saved
761 int entmsg(int is_reply, int c)
762 /* nonzero if this was a <R>eply command */
775 sprintf(cmd,"ENT0 0||0|%d",mode);
779 if ((strncmp(cmd,"570",3)) && (strncmp(cmd,"200",3))) {
780 printf("%s\n",&cmd[4]);
784 if (!strncmp(cmd,"570",3)) need_recp = 1;
786 if ((userflags & US_EXPERT) == 0) formout("entermsg");
792 strcpy(buf,reply_to);
795 printf("Enter recipient: ");
797 if (strlen(buf)==0) return(1);
800 else strcpy(buf,"sysop");
804 if (room_flags&QR_ANONOPT) {
805 printf("Anonymous (Y/N)? ");
809 /* if it's mail, we've got to check the validity of the recipient... */
811 sprintf(cmd,"ENT0 0|%s|%d|%d",buf,b,mode);
815 printf("%s\n",&cmd[4]);
820 /* learn the number of the newest message in in the room, so we can tell
821 * upon saving whether someone else has posted too
824 serv_puts("MSGS LAST|1");
827 printf("%s\n",&cmd[5]);
830 while (serv_gets(cmd), strcmp(cmd,"000")) {
831 msg_arr[num_msgs++] = atol(cmd);
835 /* now put together the message */
836 if ( make_message(temp,buf,b,0,c) != 0 ) return(2);
838 /* and send it to the server */
839 sprintf(cmd,"ENT0 1|%s|%d|%d||",buf,b,mode);
843 printf("%s\n",&cmd[4]);
848 transmit_message(fp);
854 highmsg = msg_arr[num_msgs - 1];
856 serv_puts("MSGS NEW");
859 printf("%s\n",&cmd[5]);
862 while (serv_gets(cmd), strcmp(cmd,"000")) {
863 msg_arr[num_msgs++] = atol(cmd);
867 /* get new highest message number in room to set lrp for goto... */
868 maxmsgnum = msg_arr[num_msgs - 1];
870 /* now see if anyone else has posted in here */
872 for (a=0; a<num_msgs; ++a) if (msg_arr[a]>highmsg) ++b;
874 /* in the Mail> room, this algorithm always counts one message
875 * higher than in public rooms, so we decrement it by one */
879 "*** 1 additional message has been entered in this room by another user.\n");
881 "*** %d additional messages have been entered in this room by other users.\n",b);
886 void process_quote(void) { /* do editing on quoted file */
889 int line,qstart,qend;
891 /* Unlink the second temp file as soon as it's opened, so it'll get
892 * deleted even if the program dies
894 qfile = fopen(temp2,"r");
897 /* Display the quotable text with line numbers added */
899 fgets(buf,128,qfile);
900 while (fgets(buf,128,qfile)!=NULL) {
901 printf("%2d %s",++line,buf);
903 printf("Begin quoting at [ 1] : ");
905 qstart = (buf[0]==0) ? (1) : atoi(buf);
906 printf(" End quoting at [%d] : ",line);
908 qend = (buf[0]==0) ? (line) : atoi(buf);
911 fgets(buf,128,qfile);
912 tfile=fopen(temp,"w");
913 while(fgets(buf,128,qfile)!=NULL) {
914 if ((++line>=qstart)&&(line<=qend)) fprintf(tfile," >%s",buf);
916 fprintf(tfile," \n");
925 * List the URL's which were embedded in the previous message
932 printf("There were no URL's in the previous message.\n\n");
936 for (i=0; i<num_urls; ++i) {
937 printf("%3d %s\n", i+1, urls[i]);
940 if((i = num_urls) != 1)
941 i = intprompt("Display which one", 1, 1, num_urls);
943 sprintf(cmd, rc_url_cmd, urls[i-1]);
949 void readmsgs(int c, int rdir, int q) /* read contents of a room */
950 /* 0=Read all 1=Read new 2=Read old 3=Read last q */
951 /* 1=Forward (-1)=Reverse */
952 /* Number of msgs to read (if c==3) */
959 char prtfile[PATH_MAX];
962 char targ[ROOMNAMELEN];
965 signal(SIGINT,SIG_IGN);
966 signal(SIGQUIT,SIG_IGN);
968 if (c<0) b=(MAXMSGS-1);
971 sprintf(prtfile, tmpnam(NULL));
976 case 0: strcat(cmd,"ALL");
978 case 1: strcat(cmd,"NEW");
980 case 2: strcat(cmd,"OLD");
982 case 3: sprintf(&cmd[strlen(cmd)], "LAST|%d", q);
988 printf("%s\n",&cmd[5]);
991 while (serv_gets(cmd), strcmp(cmd,"000")) {
992 if (num_msgs == MAXMSGS) {
993 memcpy(&msg_arr[0], &msg_arr[1],
994 (sizeof(long) * (MAXMSGS - 1)) );
997 msg_arr[num_msgs++] = atol(cmd);
1003 /* this loop cycles through each message... */
1004 start = ( (rdir==1) ? 0 : (num_msgs-1) );
1005 for (a=start; ((a<num_msgs)&&(a>=0)); a=a+rdir) {
1006 while (msg_arr[a]==0L) {
1007 a=a+rdir; if ((a==MAXMSGS)||(a==(-1))) return;
1010 RAGAIN: pagin=((arcflag==0)&&(quotflag==0)&&
1011 (userflags & US_PAGINATOR)) ? 1 : 0;
1013 /* If we're doing a quote, set the screenwidth to 72 temporarily */
1015 hold_sw = screenwidth;
1019 /* If printing or archiving, set the screenwidth to 80 temporarily */
1021 hold_sw = screenwidth;
1025 /* now read the message... */
1026 e=read_message(msg_arr[a],pagin);
1028 /* ...and set the screenwidth back if we have to */
1029 if ((quotflag)||(arcflag)) {
1030 screenwidth = hold_sw;
1032 RMSGREAD: fflush(stdout);
1033 highest_msg_read = msg_arr[a];
1035 freopen("/dev/tty","r+",stdout);
1037 enable_color = hold_color;
1041 freopen("/dev/tty","r+",stdout);
1043 enable_color = hold_color;
1046 freopen(prtfile, "r", stdin);
1047 sttybbs(SB_RESTORE);
1048 ka_system(printcmd);
1049 sttybbs(SB_NO_INTR);
1055 } while((g!=f)&&(g>=0));
1056 printf("Message printed.\n");
1059 if ( ((userflags&US_NOPROMPT)||(e==2))
1060 && (((room_flags&QR_MAILBOX)==0)
1061 ||(rc_force_mail_prompts==0)) ) {
1067 color(BRIGHT_WHITE);
1068 printf("%d",num_msgs-a-1);
1072 if (is_mail==1) keyopt("<R>eply ");
1073 keyopt("<B>ack <A>gain <Q>uote <N>ext <S>top ");
1074 if (rc_url_cmd[0] && num_urls) keyopt("<U>RL View ");
1075 keyopt("<?>Help/others -> ");
1079 e=(inkey()&127); e=tolower(e);
1080 /* return key same as <N> */ if (e==13) e='n';
1081 /* space key same as <N> */ if (e==32) e='n';
1082 /* del/move for aides only */ if ((!is_room_aide)
1083 &&((room_flags&QR_MAILBOX)==0)) {
1084 if ((e=='d')||(e=='m')||(e=='c')) e=0;
1086 /* print only if available */ if ((e=='p')&&(strlen(printcmd)==0)) e=0;
1087 /* can't reply in public rms */ if ((e=='r')&&(is_mail!=1)) e=0;
1088 /* can't file if not allowed */ if ((e=='f')&&(rc_allow_attachments==0)) e=0;
1089 /* link only if browser avail*/ if ((e=='u')&&(strlen(rc_url_cmd)==0)) e=0;
1090 } while((e!='a')&&(e!='n')&&(e!='s')
1091 &&(e!='d')&&(e!='m')&&(e!='p')
1092 &&(e!='q')&&(e!='b')&&(e!='h')
1093 &&(e!='r')&&(e!='f')&&(e!='?')
1094 &&(e!='u')&&(e!='c'));
1096 case 's': printf("Stop\r"); break;
1097 case 'a': printf("Again\r"); break;
1098 case 'd': printf("Delete\r"); break;
1099 case 'm': printf("Move\r"); break;
1100 case 'c': printf("Copy\r"); break;
1101 case 'n': printf("Next\r"); break;
1102 case 'p': printf("Print\r"); break;
1103 case 'q': printf("Quote\r"); break;
1104 case 'b': printf("Back\r"); break;
1105 case 'h': printf("Header\r"); break;
1106 case 'r': printf("Reply\r"); break;
1107 case 'f': printf("File\r"); break;
1108 case 'u': printf("URL's\r"); break;
1109 case '?': printf("? <help>\r"); break;
1111 if (userflags & US_DISAPPEAR)
1112 printf("\r%79s\r","");
1118 case '?': printf("Options available here:\n");
1119 printf(" ? Help (prints this message)\n");
1120 printf(" S Stop reading immediately\n");
1121 printf(" A Again (repeats last message)\n");
1122 printf(" N Next (continue with next message)\n");
1123 printf(" B Back (go back to previous message)\n");
1125 ||(room_flags&QR_MAILBOX)) {
1126 printf(" D Delete this message\n");
1127 printf(" M Move message to another room\n");
1128 printf(" C Copy message to another room\n");
1130 if (strlen(printcmd)>0)
1131 printf(" P Print this message\n");
1132 printf(" Q Quote portions of this message for your next post\n");
1133 printf(" H Headers (display message headers only)\n");
1135 printf(" R Reply to this message\n");
1136 if (rc_allow_attachments)
1137 printf(" F (save attachments to a file)\n");
1138 if (strlen(rc_url_cmd)>0)
1139 printf(" U (list URL's for display)\n");
1142 case 'p': fflush(stdout);
1143 freopen(prtfile,"w",stdout);
1145 hold_color = enable_color;
1148 case 'q': fflush(stdout);
1149 freopen(temp2,"w",stdout);
1151 hold_color = enable_color;
1155 case 'a': goto RAGAIN;
1156 case 'b': a=a-(rdir*2);
1160 newprompt("Enter target room: ",
1161 targ,ROOMNAMELEN-1);
1162 if (strlen(targ)>0) {
1163 sprintf(cmd,"MOVE %ld|%s|%d",
1168 printf("%s\n",&cmd[4]);
1169 if (cmd[0]=='2') msg_arr[a]=0L;
1174 if (cmd[0]!='2') goto RMSGREAD;
1176 case 'f': newprompt("Which section? ", filename,
1177 ((sizeof filename) -1));
1178 snprintf(cmd, sizeof cmd,
1179 "OPNA %ld|%s", msg_arr[a], filename);
1183 extract(filename, &cmd[4], 2);
1184 download_to_local_disk(filename,
1185 extract_int(&cmd[4], 0));
1188 printf("%s\n",&cmd[4]);
1191 case 'd': printf("*** Delete this message? ");
1193 sprintf(cmd,"DELE %ld",msg_arr[a]);
1196 printf("%s\n",&cmd[4]);
1197 if (cmd[0]=='2') msg_arr[a]=0L;
1203 case 'h': read_message(msg_arr[a],READ_HEADER);
1205 case 'r': entmsg(1,(DEFAULT_ENTRY==46 ? 2 : 0));
1207 case 'u': list_urls();
1210 } /* end for loop */
1211 } /* end read routine */
1217 * View and edit a system message
1219 void edit_system_message(char *which_message)
1225 sprintf(desc, "system message '%s'", which_message);
1226 sprintf(read_cmd, "MESG %s", which_message);
1227 sprintf(write_cmd, "EMSG %s", which_message);
1228 do_edit(desc, read_cmd, "NOOP", write_cmd);