⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mh-patches

📁 ftam等标准协议服务器和客户端的源代码。
💻
📖 第 1 页 / 共 2 页
字号:
  	else {****************** 575,581 ****  	    case BODY:   	    case BODYEOF:   		finish_headers (out);! 		if (whomsw)  		    break;  		fprintf (out, "\n%s", buf);  		while (state == BODY) {--- 598,604 ----  	    case BODY:   	    case BODYEOF:   		finish_headers (out);! 		if (whomsw && !fill_in)  		    break;  		fprintf (out, "\n%s", buf);  		while (state == BODY) {****************** 699,709 ****      }        hdr = &hdrtab[i];!     if (hdr -> flags & HIGN)  	return;      if (hdr -> flags & HBAD) {! 	advise (NULLCP, "illegal header line -- %s:", name);! 	badmsg++;  	return;      }      msgflags |= (hdr -> set & ~(MVIS | MINV));--- 722,739 ----      }        hdr = &hdrtab[i];!     if (hdr -> flags & HIGN) {! 	if (fill_in)! 	    fprintf (out, "%s: %s", name, str);  	return;+     }      if (hdr -> flags & HBAD) {! 	if (fill_in)! 	    fprintf (out, "%s: %s", name, str);! 	else {! 	    advise (NULLCP, "illegal header line -- %s:", name);! 	    badmsg++;! 	}  	return;      }      msgflags |= (hdr -> set & ~(MVIS | MINV));****************** 711,716 ****--- 741,751 ----      if (hdr -> flags & HSUB)  	subject = subject ? add (str, add ("\t", subject)) : getcpy (str);      if (hdr -> flags & HFCC) {+ 	if (fill_in) {+ 	    fprintf (out, "%s: %s", name, str);+ 	    return;+ 	}+   	if (cp = rindex (str, '\n'))  	    *cp = NULL;  	for (cp = pp = str; cp = index (pp, ','); pp = cp) {****************** 759,765 ****        nameoutput = linepos = 0;      (void) sprintf (namep, "%s%s",! 	    (hdr -> flags & HMNG) ? "Original-" : "", name);        for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)  	if (mp -> m_nohost) {	/* also used to test (hdr -> flags & HTRY) */--- 794,801 ----        nameoutput = linepos = 0;      (void) sprintf (namep, "%s%s",! 		    !fill_in && (hdr -> flags & HMNG) ? "Original-" : "",! 		    name);        for (grp = 0, mp = tmpaddrs.m_next; mp; mp = np)  	if (mp -> m_nohost) {	/* also used to test (hdr -> flags & HTRY) */****************** 810,817 ****  	advise (NULLCP, "%s: field does not allow groups", name);  	badmsg++;      }!     if (linepos)  	(void) putc ('\n', out);  }    /*  */--- 846,856 ----  	advise (NULLCP, "%s: field does not allow groups", name);  	badmsg++;      }!     if (linepos) {! 	if (fill_in && grp > 0)! 	    (void) putc (';', out);  	(void) putc ('\n', out);+     }  }    /*  */****************** 942,948 ****        if (mp -> m_mbox == NULL || ((flags & HTRY) && !insert (mp)))  	return 0;!     if ((flags & HBCC) || mp -> m_ingrp)  	return 1;        if (!nameoutput) {--- 981,987 ----        if (mp -> m_mbox == NULL || ((flags & HTRY) && !insert (mp)))  	return 0;!     if (!fill_in && ((flags & HBCC) || mp -> m_ingrp))  	return 1;        if (!nameoutput) {****************** 953,959 ****      if (*aka && mp -> m_type != UUCPHOST && !mp -> m_pers)  	mp -> m_pers = getcpy (aka);      if (format) {! 	if (mp -> m_gname)  	    (void) sprintf (cp = buffer, "%s;", mp -> m_gname);  	else  	    cp = adrformat (mp);--- 992,998 ----      if (*aka && mp -> m_type != UUCPHOST && !mp -> m_pers)  	mp -> m_pers = getcpy (aka);      if (format) {! 	if (mp -> m_gname && !fill_in)  	    (void) sprintf (cp = buffer, "%s;", mp -> m_gname);  	else  	    cp = adrformat (mp);****************** 987,1004 ****      int     len;      char   *cp;  !     if (flags & HBCC)  	return;        if (!nameoutput) {  	fprintf (out, "%s: ", name);  	linepos += (nameoutput = strlen (name) + 2);      }  !     cp = concat (group, ";", NULLCP);      len = strlen (cp);  !     if (linepos != nameoutput)  	if (len + linepos + 2 > outputlinelen) {  	    fprintf (out, ",\n%*s", nameoutput, "");  	    linepos = nameoutput;--- 1026,1045 ----      int     len;      char   *cp;  !     if (!fill_in && (flags & HBCC))  	return;        if (!nameoutput) {  	fprintf (out, "%s: ", name);  	linepos += (nameoutput = strlen (name) + 2);+ 	if (fill_in)+ 	    linepos -= strlen (group);      }  !     cp = fill_in ? group : concat (group, ";", NULLCP);      len = strlen (cp);  !     if (linepos > nameoutput)  	if (len + linepos + 2 > outputlinelen) {  	    fprintf (out, ",\n%*s", nameoutput, "");  	    linepos = nameoutput;*** uip/whatnowsbr.c.orig	Thu Jan 10 02:14:55 1991--- uip/whatnowsbr.c	Wed Jan  9 14:27:35 1991****************** 6,11 ****--- 6,16 ----  #include <sys/types.h>  #include <sys/stat.h>  + + #ifdef	BERK+ #undef	WP+ #endif+   /*  */    static struct swit whatnowswitches[] = {****************** 758,764 ****--- 763,778 ----      int     pid;      register int    vecp;      char   *vec[MAXARGS];+ #ifdef	WP+     char   *cp,+ 	    draft[BUFSIZ],+ 	    backup[BUFSIZ];+ #endif  + #ifdef	WP+     (void) strcpy (draft, m_scratch (file, invo_name));+ #endif+       m_update ();      (void) fflush (stdout);  ****************** 774,779 ****--- 788,797 ----  	    if (arg)  		while (*arg)  		    vec[vecp++] = *arg++;+ #ifdef	WP+ 	    vec[vecp++] = "-fill-in";+ 	    vec[vecp++] = draft;+ #endif  	    vec[vecp] = NULL;    	    execvp (whomproc, vec);****************** 782,787 ****--- 800,827 ----  	    _exit (-1);		/* NOTREACHED */    	default: + #ifndef	WP  	    return (pidwait (pid, NOTOK) & 0377 ? 1 : 0);+ #else+ 	    if (pidwait (pid, NOTOK)) {+ 		(void) unlink (draft);+ 		return 1;+ 	    }+ 	    break;+ #endif      }+ + #ifdef	WP+     if (rename (file, cp = m_backup (file)) == NOTOK) {+ 	advise (cp, "unable to rename %s to", file);+ 	(void) unlink (draft);+ 	return 1;+     }+     if (rename (draft, file) == NOTOK) {+ 	advise (file, "unable to rename %s to ", draft);+ 	return 1;+     }+ +     return 0;+ #endif  }*** uip/whom.c.orig	Thu Jan 10 02:15:30 1991--- uip/whom.c	Mon Jul 17 09:22:31 1989****************** 35,40 ****--- 35,43 ----  #define	SNOOPSW	10      "snoop", -5,  + #define	FILLSW	11+     "fill-in file", -7,+       NULL, NULL  };  ****************** 125,130 ****--- 128,134 ----  		case ALIASW:   		case CLIESW:   		case SERVSW: + 		case FILLSW:  		    vec[vecp++] = --cp;  		    if (!(cp = *argp++) || *cp == '-')  			adios (NULLCP, "missing argument to %s", argp[-2]);*** zotnet/mf/mf.c.orig	Thu Jan 10 02:10:25 1991--- zotnet/mf/mf.c	Wed Jan  9 14:27:34 1991****************** 4,9 ****--- 4,14 ----  #include <ctype.h>  #include <stdio.h>  + + #ifdef	BERK+ #undef	WP+ #endif+   /*  */    static char *getcpy (s)****************** 298,303 ****--- 303,311 ----    #define	QUOTE	'\\'  + #ifdef	WP+ #define	LX_WP	(-1)+ #endif  #define	LX_END	0  #define	LX_ERR	1  #define	LX_ATOM	2****************** 351,361 ****--- 359,380 ----    static struct adrx  adrxs2;  + + #ifdef	WP+ char   *concat ();+ + extern int	do_wp;+ char   *wp_expand ();+ #endif+   /*  */    struct adrx *getadrx (addrs)  register char   *addrs;  {+ #ifdef	WP+     int	    save_lex;+ #endif      register char   *bp;      register struct adrx *adrxp = &adrxs2;  ****************** 385,390 ****--- 404,432 ----  	    return NULL;  	}  + #ifdef	WP+     bp = cp, save_lex = last_lex;+     if (my_lex (adr) == LX_WP) {+ 	register char *ep,+ 		      *fp;+ + 	if (fp = wp_expand (adr, err)) {+ 	    *bp = NULL;+ 	    ep = concat (dp, fp, cp, (char *) NULL);+ 	    cp = ep + strlen (dp), last_lex = save_lex;+ 	    free (dp);+ 	    dp = ep;+ 	    free (fp);+ 	}+ 	else {+ 	    ap = bp, save_lex = last_lex;+ 	    goto out;+ 	}+     }+     else+ 	cp = bp, last_lex = save_lex;+ #endif+       switch (parse_address ()) {  	case DONE:  	    free (dp);****************** 409,414 ****--- 451,459 ----  	    break;  	}  + #ifdef	WP+ out: ;+ #endif      if (err[0])  	for (;;) {  	    switch (last_lex) {****************** 798,803 ****--- 843,863 ----  	cp = NULL;  	return (last_lex = LX_END);      }+ + #ifdef	WP+     if (do_wp && c == '<' && *cp == '<')+ 	for (cp++;;)+ 	    switch (c = *cp++) {+ 		case '>':+ 		    *bp = NULL;+ 		    cp++;+ 		    return (last_lex = LX_WP);+ + 		default:+ 		    *bp++ = c;+ 		    continue;+ 	    }+ #endif        if (c == '(')  	for (*bp++ = c, i = 0;;)*** zotnet/mts/client.c.orig	Thu Jan 10 02:09:09 1991--- zotnet/mts/client.c	Thu Jan 10 02:09:48 1991****************** 50,55 ****--- 50,56 ----  static struct addrent *he, *hz;  static struct addrent hosts[MAXHOSTS];  + struct hostent *gethostbystring ();    char *getcpy (), **brkstring (), **copyip ();  ****************** 63,68 ****--- 64,70 ----  int	rproto;  {      int     sd;+     unsigned int portno;      register char **ap;      char   *arguments[MAXARGS];      register struct hostent *hp;****************** 71,80 ****  #endif	BIND      register struct servent *sp;  !     if ((sp = getservbyname (service, protocol)) == NULL) {! 	(void) sprintf (response, "%s/%s: unknown service", protocol, service);! 	return NOTOK;!     }        ap = arguments;      if (args != NULL && *args != NULL)--- 73,86 ----  #endif	BIND      register struct servent *sp;  !     if (sp = getservbyname (service, protocol))! 	portno = sp -> s_port;!     else! 	if (sscanf (service, "%u", &portno) != 1) {! 	    (void) sprintf (response, "%s/%s: unknown service",! 			    protocol, service);! 	    return NOTOK;! 	}        ap = arguments;      if (args != NULL && *args != NULL)****************** 98,104 ****  		while (hp = gethostent ())  		    if (np -> n_addrtype == hp -> h_addrtype  			    && inet (hp, np -> n_net)) {! 			switch (sd = rcaux (sp, hp, rproto, response)) {  			    case NOTOK:   				continue;  			    case OOPS1: --- 104,110 ----  		while (hp = gethostent ())  		    if (np -> n_addrtype == hp -> h_addrtype  			    && inet (hp, np -> n_net)) {! 			switch (sd = rcaux (portno, hp, rproto, response)) {  			    case NOTOK:   				continue;  			    case OOPS1: ****************** 116,123 ****  	    continue;  	}  ! 	if (hp = gethostbyname (*ap)) {! 	    switch (sd = rcaux (sp, hp, rproto, response)) {  		case NOTOK:   		case OOPS1:   		    break;--- 122,129 ----  	    continue;  	}  ! 	if (hp = gethostbystring (*ap)) {! 	    switch (sd = rcaux (portno, hp, rproto, response)) {  		case NOTOK:   		case OOPS1:   		    break;****************** 137,144 ****    /*  */  ! static int  rcaux (sp, hp, rproto, response)! register struct servent *sp;  register struct hostent *hp;  int	rproto;  register char *response;--- 143,150 ----    /*  */  ! static int  rcaux (portno, hp, rproto, response)! unsigned int portno;  register struct hostent *hp;  int	rproto;  register char *response;****************** 163,169 ****        bzero ((char *) isock, sizeof *isock);      isock -> sin_family = hp -> h_addrtype;!     isock -> sin_port = sp -> s_port;      bcopy (hp -> h_addr, (char *) &isock -> sin_addr, hp -> h_length);        if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK)--- 169,175 ----        bzero ((char *) isock, sizeof *isock);      isock -> sin_family = hp -> h_addrtype;!     isock -> sin_port = portno;      bcopy (hp -> h_addr, (char *) &isock -> sin_addr, hp -> h_length);        if (connect (sd, (struct sockaddr *) isock, sizeof *isock) == NOTOK)****************** 245,250 ****--- 251,301 ----  		return NOTOK;  	}      }+ }+ + /*  */+ + #if	defined(BIND) && !defined(h_addr)+ #define	h_addr	h_addr_list[0]+ #endif+ +     + static char *empty = NULL;+ #ifdef	h_addr+ static char *addrs[2] = { NULL };+ #endif+ + struct hostent *gethostbystring (s)+ char   *s;+ {+     register struct hostent *h;+ #ifndef	DG+     static u_long iaddr;+ #else+     static struct in_addr iaddr;+ #endif+     static struct hostent   hs;+ +     iaddr = inet_addr (s);+ #ifndef	DG+     if (iaddr == NOTOK)+ #else+     if (iaddr.s_addr == NOTOK)+ #endif+ 	return gethostbyname (s);+ +     h = &hs;+     h -> h_name = s;+     h -> h_aliases = &empty;+     h -> h_addrtype = AF_INET;+     h -> h_length = sizeof (iaddr);+ #ifdef	h_addr+     h -> h_addr_list = addrs;+     bzero ((char *) addrs, sizeof addrs);+ #endif+     h -> h_addr = (char *) &iaddr;+ +     return h;  }    /*  */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -