[net.mail] pathalias mod

rees@apollo.UUCP (08/20/84)

This isn't necessarily a bug fix, it just depends on the behavior you want.

If the same link appears more than once in the input to pathalias, the
first one seen determines the cost.  This makes the output dependent on
the order of the input.  This isn't necessarily bad, especially if your
input files are ordered by reliability or age of the data.

A more reasonable method for determining the cost might be to take the
lowest cost rather than the first cost.  This seems to work better here,
because we have lots of links that appear in one place with the correct
cost, and somewhere else with no cost given.  Pathalias may use the
higher, incorrect cost in this case, unless you apply this mod.

There is also a small bug fix here.  After a link appears in one file, it
will never get reported as a duplicate even if it appears twice in another
file (unless you give -a).

In addlink.c:

*** addlink.c_o	Thu Feb  2 14:23:14 1984
--- addlink.c	Mon Aug 20 10:20:55 1984
***************
*** 18,23
  			    n->n_name, nto->n_name, l->l_ind, (long) l->l_cost,
  			    n->n_name, nto->n_name, lind, (long) cost);
  		}
  		return(l);
  	}
  

--- 18,26 -----
  			    n->n_name, nto->n_name, l->l_ind, (long) l->l_cost,
  			    n->n_name, nto->n_name, lind, (long) cost);
  		}
+ 		if (cost < l->l_cost)
+ 			l->l_cost = cost;
+ 		l->l_fcnt = fcnt;
  		return(l);
  	}