summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipng/dvipng-1.14-PATCHES/patch-03-programname
blob: f80ff0a5e40b251386a1374d8901e873bcc0fe5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);