From 801ee79a85178e4471ab02b6d6d8f1394ee0f565 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 11 Mar 2009 10:10:29 +0000 Subject: avoid using program_invocation_name in splitup.c (from Taco) git-svn-id: svn://tug.org/texlive/trunk@12365 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/web2c/ChangeLog | 4 ++++ Build/source/texk/web2c/web2c/splitup.c | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'Build/source') diff --git a/Build/source/texk/web2c/web2c/ChangeLog b/Build/source/texk/web2c/web2c/ChangeLog index 74aac9826c1..622f1cb15d2 100644 --- a/Build/source/texk/web2c/web2c/ChangeLog +++ b/Build/source/texk/web2c/web2c/ChangeLog @@ -1,3 +1,7 @@ +2009-03-11 Peter Breitenlohner + + * splitup.c: avoid using program_invocation_name (from Taco). + 2009-02-26 Karl Berry * texmf.defines (runsystem): new fn. diff --git a/Build/source/texk/web2c/web2c/splitup.c b/Build/source/texk/web2c/web2c/splitup.c index f92933c52ba..3d0dbee6929 100644 --- a/Build/source/texk/web2c/web2c/splitup.c +++ b/Build/source/texk/web2c/web2c/splitup.c @@ -9,11 +9,30 @@ #include "config.h" #include +#if defined (FATAL) +#undef FATAL +#endif + +#define FATAL(str) do { \ + fprintf (stderr, "%s: fatal: ", argv[0]); \ + fputs (str, stderr); \ + fputs (".\n", stderr); exit (1); } while (0) + + +#if defined (FATAL1) +#undef FATAL1 +#endif + +#define FATAL1(str, e1) do { \ + fprintf (stderr, "%s: fatal: ", argv[0]); \ + fprintf (stderr, str, e1); \ + fputs (".\n", stderr); exit (1); } while (0) + + #ifdef VMS #define unlink delete #endif -char *program_invocation_name; int filenumber = 0, ifdef_nesting = 0, lines_in_file = 0; char *output_name = NULL; boolean has_ini; @@ -63,8 +82,6 @@ main P2C(int, argc, string *, argv) unsigned coerce_len; int option; - program_invocation_name = argv[0]; - while ((option = getopt(argc, argv, "il:")) != -1) { switch (option) { case 'i': -- cgit v1.2.3