about summary refs log tree commit diff
path: root/lib/libpm.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-04-20 23:55:59 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2017-04-20 23:55:59 +0000
commit0983b116fce1f3b536e2159f7b1142f04ce3d937 (patch)
tree1d8f5d6f73f1fc19a15e4d4e91397cd7e067aafb /lib/libpm.c
parentba0b4e1aa239457bcf5d99aa694fb803d3cc80a3 (diff)
downloadnetpbm-mirror-0983b116fce1f3b536e2159f7b1142f04ce3d937.tar.gz
netpbm-mirror-0983b116fce1f3b536e2159f7b1142f04ce3d937.tar.xz
netpbm-mirror-0983b116fce1f3b536e2159f7b1142f04ce3d937.zip
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2960 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpm.c')
-rw-r--r--lib/libpm.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/libpm.c b/lib/libpm.c
index 2e2097ec..dbfcac12 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -776,10 +776,17 @@ extractAfterLastSlash(const char * const fullPath,
         strncpy(retval, slashPos +1, retvalSize);
         retval[retvalSize-1] = '\0';
     }
+}
+
+
 
-    /* Chop any .exe off the right end */
-    if (strlen(retval) >= 4 && strcmp(retval+strlen(retval)-4, ".exe") == 0)
-        retval[strlen(retval)-4] = 0;
+static void
+chopOffExe(char * const arg) {
+/*----------------------------------------------------------------------------
+  Chop any .exe off the right end of 'arg'.
+-----------------------------------------------------------------------------*/
+    if (strlen(arg) >= 4 && strcmp(arg+strlen(arg)-4, ".exe") == 0)
+        arg[strlen(arg)-4] = 0;
 }
 
 
@@ -814,6 +821,7 @@ pm_arg0toprogname(const char arg0[]) {
 #else
     static char retval[MAX_RETVAL_SIZE+1];
     extractAfterLastSlash(arg0, retval, sizeof(retval));
+    chopOffExe(retval);
 #endif
 
     return retval;