]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/ntservice.c
Happy New Year
[openldap] / libraries / liblutil / ntservice.c
index 6dd05a4ca30fe00edf4f94f4cbe9ff98c8252214..a42b4842b467b006cb042540fe79fd83b7687ebd 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2015 The OpenLDAP Foundation.
+ * Copyright 1998-2018 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 = ' ';