ITS#8705 fix service pathname

Strip trailing space of last pathname component, if any. Not first.
This commit is contained in:
Howard Chu 2017-08-03 12:42:21 +01:00
parent a5f3a2885c
commit af92b8d2ca

View file

@ -58,8 +58,9 @@ int lutil_srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName,
HKEY hKey;
DWORD dwValue, dwDisposition;
SC_HANDLE schSCManager, schService;
char *sp = strchr( lpszBinaryPathName, ' ');
char *sp = strrchr( lpszBinaryPathName, '\\');
if ( sp ) sp = strchr(sp, ' ');
if ( sp ) *sp = '\0';
fprintf( stderr, "The install path is %s.\n", lpszBinaryPathName );
if ( sp ) *sp = ' ';