From: Howard Chu Date: Mon, 3 Mar 2003 07:30:12 +0000 (+0000) Subject: Fix previous commit, eventlog path was wrong X-Git-Tag: NO_SLAP_OP_BLOCKS~208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6e8adce9d94ffff125d6acce669c35245d73d0df;p=openldap Fix previous commit, eventlog path was wrong --- diff --git a/libraries/liblutil/ntservice.c b/libraries/liblutil/ntservice.c index c5c12569fe..2d761b3167 100644 --- a/libraries/liblutil/ntservice.c +++ b/libraries/liblutil/ntservice.c @@ -63,8 +63,11 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName, HKEY hKey; DWORD dwValue, dwDisposition; SC_HANDLE schSCManager, schService; + char *sp = strchr( lpszBinaryPathName, ' '); + if ( sp ) *sp = '\0'; fprintf( stderr, "The install path is %s.\n", lpszBinaryPathName ); + if ( sp ) *sp = ' '; if ((schSCManager = OpenSCManager( NULL, NULL, SC_MANAGER_CONNECT|SC_MANAGER_CREATE_SERVICE ) ) != NULL ) { if ((schService = CreateService( @@ -95,6 +98,7 @@ int srv_install(LPCTSTR lpszServiceName, LPCTSTR lpszDisplayName, RegCloseKey(hKey); return(0); } + if ( sp ) *sp = '\0'; if ( RegSetValueEx(hKey, "EventMessageFile", 0, REG_EXPAND_SZ, lpszBinaryPathName, strlen(lpszBinaryPathName) + 1) != ERROR_SUCCESS) { fprintf( stderr, "RegSetValueEx(EventMessageFile) failed. GetLastError=%lu (%s)\n", GetLastError(), GetLastErrorString() );