Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-lcc!styx!ptsfa!hoptoad!academ!uhnix1!nuchat!steve From: steve@nuchat.UUCP (Steve Nuchia) Newsgroups: news.software.b Subject: bogus (?) code in expire.c Message-ID: <214@nuchat.UUCP> Date: Wed, 29-Apr-87 11:36:25 EDT Article-I.D.: nuchat.214 Posted: Wed Apr 29 11:36:25 1987 Date-Received: Thu, 7-May-87 07:23:42 EDT Organization: Public Access - Houston, Tx Lines: 67 Keywords: expire -a sometimes no-op Something's fishy here.... ulall() in expire.c attempts to disect the list of names by which a condemned article is known, then it executes a body of code that correctly disposes of that article. However, there seems to be a sepcial case that circumvents most of the processing, including archiving. Observe: /* Unlink (using unwound tail recursion) all the articles in 'artlist'. */ ulall(artlist, hp) { [...] do { [...] while (*artlist == ' ' || *artlist == '\n' || *artlist == ',') artlist++; if (*artlist == '\0') return; p = index(artlist, ' '); if (p == NULL) { last = 1; p = index(artlist, '\n'); } [this looks REAL fishy -- it seems to happen to the last name] if (p == NULL) { last = 1; fn = dirname(artlist); [look, ma! no verbose, no archive!] if (UNLINK(fn) < 0 && errno != ENOENT) perror(fn); return; } [end of fishy part] if (p) *p = 0; [beginning of normal destruction sequence] [...] if (ngmatch(newname, ngpat)) { if (doarchive) [archive code here [...]] if (verbose) [etc...] if (UNLINK(fn) < 0 && errno != ENOENT) perror(fn); } [...] artlist = p + 1; } while (!last); } --------------- Ok, on another inspection I see that it only happens if the list of names is not terminated with a newline. But WHY? I don't see how things would work any less well without the fishy code... unless its the "artlist = p + 1" you're worried about... That's easy enough to fix... in fact it is fixed, since last has already been set. Useless and dangerous code. Or have I missed something? I'm running with the fishy section commented out, although I see now that this probably isn't the reason my oldnews directory wasn't growing. I probably need to rebuild my history files. sigh. This is a lot of lines for such a small problem, but I'll go ahead and post it anyway... Tailbone (vestigal) code like this is best exposed and removed as soon as possible. steve