diff options
Diffstat (limited to 'Build/source/texk/dvipng/dvipng-PATCHES/patch-03-programname')
-rw-r--r-- | Build/source/texk/dvipng/dvipng-PATCHES/patch-03-programname | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Build/source/texk/dvipng/dvipng-PATCHES/patch-03-programname b/Build/source/texk/dvipng/dvipng-PATCHES/patch-03-programname new file mode 100644 index 00000000000..e106c3a0789 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-PATCHES/patch-03-programname @@ -0,0 +1,62 @@ +diff -ur dvipng-1.15.orig/misc.c dvipng-1.15/misc.c +--- dvipng-1.15.orig/misc.c 2015-03-02 20:33:56.000000000 +0100 ++++ dvipng-1.15/misc.c 2015-03-03 13:35:10.000000000 +0100 +@@ -47,24 +47,43 @@ + int32_t number; /* Temporary storage for numeric parameter */ + char *dviname=NULL; /* Name of dvi file */ + char *outname=NULL; /* Name of output file */ ++ char *base; /* basename of argv[0] */ + +- if (argv[0]) { ++#ifdef HAVE_LIBKPATHSEA ++ /* we certainly don't want to modify argv[0]. */ ++ programname = xstrdup (argv[0] ? argv[0] : PACKAGE_NAME); ++# ifdef HAVE_KPSE_PROGRAM_BASENAME ++ base = kpse_program_basename (programname); ++# else ++ base = xstrdup (xbasename (programname)); ++ { ++ char *dot = strrchr (base, '.'); ++ if (dot && FILESTRCASEEQ (dot, ".exe")) ++ *dot = 0; ++ } ++# endif ++#else ++ /* we certainly don't want to modify argv[0]. */ ++ programname = strdup (argv[0] ? argv[0] : PACKAGE_NAME); ++ base = strrchr (programname, '/'); ++ if (base) ++ base++; ++ else ++ base = programname; ++#endif + #ifdef HAVE_GDIMAGEGIF +- programname=strrchr(argv[0],'/'); +- if (programname!=NULL) +- programname++; +- else +- programname=argv[0]; +- if (strncmp(programname,"dvigif",6)==0) +- option_flags |= GIF_OUTPUT; ++# ifdef HAVE_LIBKPATHSEA ++ if (FILESTRCASEEQ (base, "dvigif")) ++# else ++ if (strncmp(programname,"dvigif",6)==0) ++# endif ++ option_flags |= GIF_OUTPUT; + #endif +- programname=argv[0]; +- Message(BE_NONQUIET,"This is %s",programname); +- if (strcmp(basename(programname),PACKAGE_NAME)!=0) +- Message(BE_NONQUIET," (%s)", PACKAGE_NAME); +- Message(BE_NONQUIET," %s Copyright 2002-2015 Jan-Ake Larsson\n", +- PACKAGE_VERSION); +- } ++ Message(BE_NONQUIET,"This is %s",programname); ++ if (strcmp(base,PACKAGE_NAME)!=0) ++ Message(BE_NONQUIET," (%s)", PACKAGE_NAME); ++ Message(BE_NONQUIET," %s Copyright 2002-2015 Jan-Ake Larsson\n", ++ PACKAGE_VERSION); + + for (i=1; i<argc; i++) { + if (*argv[i]=='-') { |