diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-06-30 03:27:10 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2017-06-30 03:27:10 +0000 |
commit | 08d938dc6fc6b30e5da6733b52c97169c0d24f8a (patch) | |
tree | 92673cd6a5755fc209078cc6b6a42602defc0212 /lib/libpm.c | |
parent | e21f4e95d897c93a4779bf78c71f1341d164a222 (diff) | |
download | netpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.tar.gz netpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.tar.xz netpbm-mirror-08d938dc6fc6b30e5da6733b52c97169c0d24f8a.zip |
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3018 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpm.c')
-rw-r--r-- | lib/libpm.c | 14 |
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; |