Skip to content
Snippets Groups Projects
Commit ff105482 authored by rswindell's avatar rswindell
Browse files

Sort (alphabetically) the Bad Area file (badarea.lst) when saving.

parent 7e73f9d4
No related branches found
No related tags found
No related merge requests found
......@@ -753,16 +753,23 @@ int main(int argc, char **argv)
" `<tag>` is the network's agreed-upon `echo tag` for the message area\r\n"
" `[link]` is an `FTN address` to send and receive messages for this area\r\n"
" (there may be many linked nodes for each area)\r\n"
" (often your FTN hub may be the only linked node)\r\n"
"\r\n"
"Example Area Line:\r\n"
"\r\n"
" `FIDO_BBS_CARN BBS_CARNIVAL 1:218/700`\r\n"
"\r\n"
"Notes:\r\n"
"\r\n"
" * Only the `<code>` and `<tag>` fields are required\r\n"
" * The '`<`' and '`>`', '`[`' and '`]`' characters are not part of the syntax\r\n"
" * Lines beginning with a semicolon (`;`) are ignored (i.e. comments)\r\n"
" * Leading white-space characters are ignored\r\n"
" * Blank lines are ignored\r\n"
" * This file may be import/exported to/from your `Message Areas` in `SCFG`\r\n"
" * This file may be remotely modified by authorized nodes using `AreaFix`\r\n"
" `*` Only the `<code>` and `<tag>` fields are required\r\n"
" `*` The `<code>` and `<tag>` fields are case in-sensitive\r\n"
" `*` The `[link]` fields must be 2D, 3D, or 4D FidoNet-style node addresses\r\n"
" `*` The '`<`' and '`>`', '`[`' and '`]`' characters are not part of the syntax\r\n"
" `*` Lines beginning with a semicolon (`;`) are ignored (i.e. comments)\r\n"
" `*` Leading white-space characters are ignored\r\n"
" `*` Blank lines are ignored\r\n"
" `*` This file may be import/exported to/from your `Message Areas` in `SCFG`\r\n"
" `*` This file may be remotely modified by authorized nodes using `AreaFix`\r\n"
;
uifc.input(WIN_MID|WIN_SAV,0,0,"Area File"
,cfg.areafile,sizeof(cfg.areafile)-1
......@@ -774,17 +781,21 @@ int main(int argc, char **argv)
"~ Bad Area File ~\r\n\r\n"
"This is the path of the file SBBSecho will use to record the names\r\n"
"(echo tags) and descriptions of FTN message areas (echoes) that your\r\n"
"system has received EchoMail for, but does not carry locally (default\r\n"
"is `data/badarea.lst`).\r\n"
"system has received EchoMail for, but does not carry locally. The\r\n"
"default path/filename is `data/badareas.lst`.\r\n"
"\r\n"
"Notes:\r\n"
"\r\n"
"The descriptions of the areas will only be included if the corresponding\r\n"
"echo tags can be located in one of your configured `Additional EchoLists`.\r\n"
" `*` The descriptions of the areas will only be included if the\r\n"
" corresponding echo tags can be located in one of your configured\r\n"
" `Additional EchoLists`.\r\n"
"\r\n"
"The format of the file is the same as `BACKBONE.NA` and suitable for\r\n"
"importing into a Synchronet Message Group using `SCFG`.\r\n"
" `*` The format of the file is the same as `BACKBONE.NA` and suitable for\r\n"
" importing into a Synchronet Message Group using `SCFG`.\r\n"
"\r\n"
"SBBSecho will automatically remove areas from this list when they\r\n"
"are added to your configuration (SCFG->Message Areas and Area File).\r\n"
" `*` SBBSecho will automatically sort and maintain this list, removing\r\n"
" areas if they are added to your configuration (`SCFG->Message Areas`\r\n"
" and `Area File`).\r\n"
;
uifc.input(WIN_MID|WIN_SAV,0,0,"Bad Area File"
,cfg.badareafile,sizeof(cfg.badareafile)-1
......
......@@ -2334,10 +2334,11 @@ void cleanup(void)
if(fp == NULL) {
lprintf(LOG_ERR, "ERROR %d (%s) opening %s", errno, strerror(errno), cfg.badareafile);
} else {
while((p=strListPop(&bad_areas)) != NULL) {
strListSortAlpha(bad_areas);
for(int i=0; bad_areas[i] != NULL; i++) {
p = bad_areas[i];
lprintf(LOG_DEBUG, "Writing '%s' (%p) to %s", p, p, cfg.badareafile);
fprintf(fp, "%-*s %s\n", FIDO_AREATAG_LEN, p, area_desc(p));
free(p);
}
fclose(fp);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment