[comp.mail.elm] Patch 9 broke newalias

jpr@jpradley.jpr.com (Jean-Pierre Radley) (12/23/90)

Patch 9 changed newalias.c to make sure that the alias.text source lines
contain two equal signs. Newalias quits if this condition isn't met.
Unfortuantely, as it stands this patch breaks newalias.

Here's the bad portion of the code:

	.
	.
	int  first, last, i = 0, j = 0;

	/* check for two = signs */	/* Next 9 lines added by patch 9 */
	for (i = 0, j = 0; buffer[i]; i++)
	    if (buffer[i] == '=')
		j++;

	if (j < 2) {
	    printf("Error - alias data line is not in proper format:\n'%s'\n", buffer);
	    error++;
	    return;
	}
	 
	remove_all(' ', TAB, buffer);

	for (i=0; buffer[i] != '=' && i < LONG_STRING; i++)
	  aliases[i] = buffer[i];
	aliases[i] = '\0';

	j = 0;		/* JPRadley, line inserted: j should start at 0,  */
			/* not value 2 from above check for 2 equal signs */

	for (i=strlen(buffer)-1; buffer[i] != '=' && i > 0; i--)
	  address[j++] = buffer[i];
	address[j] = '\0';
	.
	.
-- 

 Jean-Pierre Radley	    NYC Public Unix	jpr@jpr.com	CIS: 72160,1341