#include "rcv.h"
-static char *SccsId = "@(#)names.c 1.1 %G%";
+static char *SccsId = "@(#)names.c 2.6 %G%";
/*
* Allocate a single element of a name list,
time(&now);
date = ctime(&now);
while (np != NIL) {
- if (!any('/', np->n_name) && np->n_name[0] != '|') {
+ if (!isfileaddr(np->n_name) && np->n_name[0] != '|') {
np = np->n_flink;
continue;
}
wait(&s);
switch (pid = fork()) {
case 0:
- signal(SIGHUP, SIG_IGN);
- signal(SIGINT, SIG_IGN);
- signal(SIGQUIT, SIG_IGN);
+ sigchild();
+ sigsys(SIGHUP, SIG_IGN);
+ sigsys(SIGINT, SIG_IGN);
+ sigsys(SIGQUIT, SIG_IGN);
close(0);
dup(image);
close(image);
return(top);
}
+/*
+ * Determine if the passed address is a local "send to file" address.
+ * If any of the network metacharacters precedes any slashes, it can't
+ * be a filename. We cheat with .'s to allow path names like ./...
+ */
+isfileaddr(name)
+ char *name;
+{
+ register char *cp;
+ extern char *metanet;
+
+ if (any('@', name))
+ return(0);
+ if (*name == '+')
+ return(1);
+ for (cp = name; *cp; cp++) {
+ if (*cp == '.')
+ continue;
+ if (any(*cp, metanet))
+ return(0);
+ if (*cp == '/')
+ return(1);
+ }
+ return(0);
+}
+
/*
* Map all of the aliased users in the invoker's mailrc
* file and insert them into the list.
n = n->n_flink;
continue;
}
- cp = n->n_name;
- while (*cp == '\\')
- cp++;
- *ap++ = cp;
+ *ap++ = n->n_name;
n = n->n_flink;
}
*ap = NOSTR;
register struct name *np;
for (np = names; np != NIL; np = np->n_flink)
- if ((np->n_type & GDEL) == 0 && equal(myname, np->n_name)) {
+ if ((np->n_type & GDEL) == 0 && equal(np->n_name, myname)) {
selfsent++;
return;
}
/*
* Delete the given name from a namelist.
*/
-
struct name *
delname(np, name)
register struct name *np;
register struct name *p;
for (p = np; p != NIL; p = p->n_flink)
- if (equal(p->n_name, name)) {
+ if (icequal(p->n_name, name)) {
if (p->n_blink == NIL) {
if (p->n_flink != NIL)
p->n_flink->n_blink = NIL;