Updates for newsgroup names

This commit is contained in:
Michiel Broek
2004-04-13 08:05:06 +00:00
parent 1e002f4cb4
commit 3cb9d2a1e4
7 changed files with 38 additions and 4 deletions

View File

@@ -35,8 +35,22 @@
void command_list(char *cmd)
{
FILE *fp;
char *temp;
send_nntp("215 List of newsgroups follows");
temp = calloc(PATH_MAX, sizeof(char));
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r"))) {
fread(&msgshdr, sizeof(msgshdr), 1, fp);
while (fread(&msgs, msgshdr.recsize, 1, fp) == 1) {
fseek(fp, msgs.syssize, SEEK_CUR);
}
} else {
WriteError("$Can't open %s", temp);
}
free(temp);
send_nntp(".");
}