TIP: Click on subject to list as thread! ANSI
echo: makenl_ng
to: Andrew Leary
from: Kees van Eeten
date: 2017-11-24 12:41:16
subject: Dailylists with makenl_ng

Hello Andrew!

24 Nov 17 05:58, you wrote to Ward Dossche:

 AL> Besides, the coding and testing time for this change will be minimal, as
 AL> the code is basically already written.

 I found that there are 4 superfluous curly brackets in my code example.
 This is what the whole case should look like:

        case CFG_PUBLISH:
            NewExtWDay = xlate_switch(strupper(args[0]), DOWSwitchTab);
            if (NewExtWDay == -1)
            {
                mklog(LOG_ERROR, "%s -- Invalid day of week '%s'",
                        cfgline, args[0]);
                mode = -1;
                break;
            }
            time(&thetime);
            mytime = localtime(&thetime);
            if (NewExtWDay == 7)
                NewExtWDay = mytime->tm_wday;
            if (NewExtWDay == 8)
                NewExtWDay = mytime->tm_wday + 1;
            NewExtWDay = (NewExtWDay + 1) % 7; /* publishing day->new
                                                  filextension day */
            break;


For completeness the is the other change in it's complete context.

static const struct switchstruct DOWSwitchTab[] = {
    {"SUNDAY", 3, 0},
    {"MONDAY", 3, 1},
    {"TUESDAY", 3, 2},
    {"WEDNESDAY", 3, 3},
    {"THURSDAY", 3, 4},
    {"FRIDAY", 3, 5},
    {"SATURDAY", 3, 6},
    {"TODAY", 3, 7},
    {"TOMORROW", 3, 8},
    {NULL, 0, -1}
};

Kees

--- GoldED+/LNX 1.1.5
* Origin: As for me, all I know is that, I know nothing. (2:280/5003.4)
SEEN-BY: 3/50 154/10 203/0 221/0 1 229/426 240/1120 5832 261/38 280/464 2020
SEEN-BY: 280/5003 5006 5555 292/624 854 310/31 423/120 633/267 280 712/620 848
SEEN-BY: 770/1 2320/100
@PATH: 280/5003 464 712/848 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.