summaryrefslogtreecommitdiff
path: root/mail/pathalias/files/patch-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/pathalias/files/patch-main.c')
-rw-r--r--mail/pathalias/files/patch-main.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/mail/pathalias/files/patch-main.c b/mail/pathalias/files/patch-main.c
new file mode 100644
index 000000000000..d9e91c6c255a
--- /dev/null
+++ b/mail/pathalias/files/patch-main.c
@@ -0,0 +1,82 @@
+--- main.c.orig 1993-03-03 22:10:02.000000000 +0100
++++ main.c 2013-06-16 17:10:48.000000000 +0200
+@@ -1,6 +1,6 @@
+-/* pathalias -- by steve bellovin, as told to peter honeyman */
++/*_pathalias -- by steve bellovin, as told to peter honeyman */
+ #ifndef lint
+-static char *sccsid = "@(#)main.c 9.8 91/06/11";
++static const char *sccsid = "@(#)main.c 9.8 91/06/11";
+ #endif
+
+ #ifndef VMS
+@@ -9,10 +9,13 @@
+ #define MAIN XXmain
+ #endif
+
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
+ #include "def.h"
+
+ /* exports */
+-char *Cfile; /* current input file */
++const char *Cfile; /* current input file */
+ char *Graphout; /* file for dumping edges (-g option) */
+ char *Linkout; /* file for dumping shortest path tree */
+ char **Argv; /* external copy of argv (for input files) */
+@@ -26,26 +29,20 @@
+ int InetFlag; /* local host is w/in scope of DNS (-I flag) */
+ int Lineno = 1; /* line number within current input file */
+ int Argc; /* external copy of argc (for input files) */
+-extern void die();
+-extern int tracelink();
+
+ /* imports */
+ extern char *optarg;
+ extern int optind;
+ extern long Lcount, Ncount;
+-extern long allocation();
+-extern void wasted(), mapit(), hashanalyze(), deadlink();
+-extern char *local();
+-extern node *addnode();
+-extern int getopt(), yyparse();
+-extern void printit();
+
+ #define USAGE "usage: %s [-vciDfI] [-l localname] [-d deadlink] [-t tracelink] [-g edgeout] [-s treeout] [-a avoid] [files ...]\n"
+
++int
+ MAIN(argc, argv)
+ register int argc;
+ register char **argv;
+-{ char *locname = 0, *bang;
++{ const char *locname = 0;
++ char *bang;
+ register int c;
+ int errflg = 0;
+
+@@ -122,14 +119,14 @@
+ Argv[0], locname);
+ }
+
+- Home = addnode(locname); /* add home node */
++ Home = addnode(strsave(locname)); /* add home node */
+ Home->n_cost = 0; /* doesn't cost to get here */
+
+ (void) yyparse(); /* read in link info */
+
+ if (Vflag > 1)
+ hashanalyze();
+- vprintf(stderr, "%d nodes, %d links, alloc %ldk\n",
++ vprintf(stderr, "%ld nodes, %ld links, alloc %ldk\n",
+ Ncount, Lcount, allocation());
+
+ Cfile = "[backlinks]"; /* for tracing back links */
+@@ -150,7 +147,7 @@
+
+ void
+ die(s)
+- char *s;
++ const char *s;
+ {
+ #ifdef DEBUG
+ extern int abort();