diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-01-07 11:43:13 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2011-01-07 11:43:13 +0000 |
commit | b193da52395b4e98368f28044ae107d33df6d9d0 (patch) | |
tree | b1dd376a762ad291b941a630b52504fba298f340 /Build/source/texk/dvipng | |
parent | 4d1718ff4f4ebbc85e009c6c5d53ed3055c84a6b (diff) |
Check for argv[0] with .exe via strcasecmp()
and more
git-svn-id: svn://tug.org/texlive/trunk@20961 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipng')
5 files changed, 79 insertions, 10 deletions
diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog index 1ddd1a09a6f..18066504b37 100644 --- a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/ChangeLog @@ -1,11 +1,21 @@ +2010-12-30 Peter Breitenlohner <peb@mppmu.mpg.de> + + * patch-03-programname (new): Use basename() as defined in + <libgen.h> or xbasename() from kpathsea to extract programname + from argv[0]. Avoid uninitialized use of programname. + + * patch-04-dvigif (new): Check for argv[0] with .exe via + strcasecmp(), if possible. + 2010-12-15 Peter Breitenlohner <peb@mppmu.mpg.de> * Imported release 1.14 from savannah.nongnu.org. - * patch-[2]?-* (removed): Included in 1.14. + * patch-2?-* (removed): Included in 1.14. * patch-01-gd-copyright (new): Include full gd copyright notice into dvipng.texi; seems the safe thing to do. - patch-02-const (new): Avoid compiler warnings. + + * patch-02-const (new): Avoid compiler warnings. 2010-10-02 Peter Breitenlohner <peb@mppmu.mpg.de> diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-03-programname b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-03-programname new file mode 100644 index 00000000000..f80ff0a5e40 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-03-programname @@ -0,0 +1,32 @@ +diff -ur dvipng-1.14.orig/misc.c dvipng-1.14/misc.c +--- dvipng-1.14.orig/misc.c 2010-09-30 12:13:40.000000000 +0200 ++++ dvipng-1.14/misc.c 2010-12-30 17:41:20.000000000 +0100 +@@ -34,7 +34,7 @@ + #endif + #include <sys/stat.h> + +-static char *programname; ++static const char *programname = PACKAGE_NAME; /* just in case */ + + /*-->DecodeArgs*/ + /*********************************************************************/ +@@ -50,17 +50,13 @@ + + if (argv[0]) { + #ifdef HAVE_GDIMAGEGIF +- programname=strrchr(argv[0],'/'); +- if (programname!=NULL) +- programname++; +- else +- programname=argv[0]; ++ programname=basename(argv[0]); + if (strncmp(programname,"dvigif",6)==0) + option_flags |= GIF_OUTPUT; + #endif + programname=argv[0]; + Message(BE_NONQUIET,"This is %s",programname); +- if (strcmp(basename(programname),PACKAGE_NAME)!=0) ++ if (strcmp(basename(argv[0]),PACKAGE_NAME)!=0) + Message(BE_NONQUIET," (%s)", PACKAGE_NAME); + Message(BE_NONQUIET," %s Copyright 2002-2010 Jan-Ake Larsson\n", + PACKAGE_VERSION); diff --git a/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-04-dvigif b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-04-dvigif new file mode 100644 index 00000000000..d60569ada86 --- /dev/null +++ b/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-04-dvigif @@ -0,0 +1,27 @@ +diff -ur dvipng-1.14.orig/configure.ac dvipng-1.14/configure.ac +--- dvipng-1.14.orig/configure.ac 2010-10-22 20:15:24.000000000 +0200 ++++ dvipng-1.14/configure.ac 2010-12-30 18:18:32.000000000 +0100 +@@ -127,7 +127,7 @@ + AC_FUNC_MMAP + AC_FUNC_STRTOD + AC_FUNC_VPRINTF +-AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr]) ++AC_CHECK_FUNCS([dup2 memset munmap pow putenv strcasecmp strchr strrchr strtol strstr]) + if test "$enable_timing" = "yes"; then + AC_CHECK_FUNCS([ftime gettimeofday]) + fi +diff -ur dvipng-1.14.orig/misc.c dvipng-1.14/misc.c +--- dvipng-1.14.orig/misc.c 2010-12-30 17:41:20.000000000 +0100 ++++ dvipng-1.14/misc.c 2010-12-30 18:26:39.000000000 +0100 +@@ -51,7 +51,11 @@ + if (argv[0]) { + #ifdef HAVE_GDIMAGEGIF + programname=basename(argv[0]); ++# if defined(HAVE_STRCASECMP) || defined(HAVE_LIBKPATHSEA) ++ if (!strcmp(programname,"dvigif") || !strcasecmp(programname,"dvigif.exe")) ++# else + if (strncmp(programname,"dvigif",6)==0) ++# endif + option_flags |= GIF_OUTPUT; + #endif + programname=argv[0]; diff --git a/Build/source/texk/dvipng/dvipng-1.14/configure.ac b/Build/source/texk/dvipng/dvipng-1.14/configure.ac index 0630bb136a4..5b8c70792e1 100644 --- a/Build/source/texk/dvipng/dvipng-1.14/configure.ac +++ b/Build/source/texk/dvipng/dvipng-1.14/configure.ac @@ -127,7 +127,7 @@ AC_FUNC_MALLOC AC_FUNC_MMAP AC_FUNC_STRTOD AC_FUNC_VPRINTF -AC_CHECK_FUNCS([dup2 memset munmap pow putenv strchr strrchr strtol strstr]) +AC_CHECK_FUNCS([dup2 memset munmap pow putenv strcasecmp strchr strrchr strtol strstr]) if test "$enable_timing" = "yes"; then AC_CHECK_FUNCS([ftime gettimeofday]) fi diff --git a/Build/source/texk/dvipng/dvipng-1.14/misc.c b/Build/source/texk/dvipng/dvipng-1.14/misc.c index aaf5f20f823..42528767070 100644 --- a/Build/source/texk/dvipng/dvipng-1.14/misc.c +++ b/Build/source/texk/dvipng/dvipng-1.14/misc.c @@ -34,7 +34,7 @@ #endif #include <sys/stat.h> -static char *programname; +static const char *programname = PACKAGE_NAME; /* just in case */ /*-->DecodeArgs*/ /*********************************************************************/ @@ -50,17 +50,17 @@ bool DecodeArgs(int argc, char ** argv) if (argv[0]) { #ifdef HAVE_GDIMAGEGIF - programname=strrchr(argv[0],'/'); - if (programname!=NULL) - programname++; - else - programname=argv[0]; + programname=basename(argv[0]); +# if defined(HAVE_STRCASECMP) || defined(HAVE_LIBKPATHSEA) + if (!strcmp(programname,"dvigif") || !strcasecmp(programname,"dvigif.exe")) +# 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) + if (strcmp(basename(argv[0]),PACKAGE_NAME)!=0) Message(BE_NONQUIET," (%s)", PACKAGE_NAME); Message(BE_NONQUIET," %s Copyright 2002-2010 Jan-Ake Larsson\n", PACKAGE_VERSION); |