ð thus on Sat, 13 Apr 1996 21:57:02 -0600 (MDT), Eric virtually scripted...
>> #1: I know this may be a little silly.. but I'm kinda lazy right now:P
>> Has anyone made an online read for bug/idea/typo files?
>>
Eric> In do_show, add the approriate entry to the command table, then:
Eric> case XX: /* Where XX is the approriate number for the command */ if
Eric> (!value || !*value) { send_to_char("Usage: show file [ bugs | ideas |
Eric> typos ]\r\n", ch); break; }
Eric> i = strlen(value);
Eric> if (!strn_cmp(value, "bugs", i)) file = BUG_FILE; else if
Eric> (!strn_cmp(value, "ideas", i)) file = IDEA_FILE; else if
Eric> (!strn_cmp(value, "typos", i)) file = TYPO_FILE; else {
Eric> send_to_char("That is not a valid file.\r\n", ch); break; }
Eric> if (file_to_string(file, buf) == -1) send_to_char("Sorry, an error
Eric> occurred while reading that file.\r\n", ch)\ ; else
Eric> page_string(ch->desc, buf, 1); break;
watch yourself... if length of file > size of buf, you will get core from a
bound exceeding
This archive was generated by hypermail 2b30 : 12/18/00 PST