commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1412017 - /commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c
Date Wed, 21 Nov 2012 08:51:12 GMT
Author: mturk
Date: Wed Nov 21 08:51:11 2012
New Revision: 1412017

URL: http://svn.apache.org/viewvc?rev=1412017&view=rev
Log:
DAEMON-261: Allow services names with spaces

Modified:
    commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c

Modified: commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?rev=1412017&r1=1412016&r2=1412017&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c Wed Nov
21 08:51:11 2012
@@ -555,6 +555,7 @@ static BOOL docmdInstallService(LPAPXCMD
     DWORD dwStart = SERVICE_DEMAND_START;
     DWORD dwType  = SERVICE_WIN32_OWN_PROCESS;
     WCHAR szImage[SIZ_HUGLEN];
+    WCHAR szName[SIZ_BUFLEN];
 
     apxLogWrite(APXLOG_MARK_DEBUG "Installing service...");
     hService = apxCreateService(gPool, SC_MANAGER_CREATE_SERVICE, FALSE);
@@ -583,8 +584,11 @@ static BOOL docmdInstallService(LPAPXCMD
     /* Replace not needed qoutes */
     apxStrQuoteInplaceW(szImage);
     /* Add run-service command line option */
-    lstrlcatW(szImage, SIZ_HUGLEN, L" //RS//");
-    lstrlcatW(szImage, SIZ_HUGLEN, lpCmdline->szApplication);
+    lstrlcatW(szImage, SIZ_HUGLEN, L" ");
+    lstrlcatW(szName, SIZ_BUFLEN, L"//RS//");
+    lstrlcatW(szName, SIZ_HUGLEN, lpCmdline->szApplication);
+    apxStrQuoteInplaceW(szName);
+    lstrlcatW(szImage, SIZ_HUGLEN, szName);
     SO_INSTALL = apxPoolStrdupW(gPool, szImage);
     /* Ensure that option gets saved in the registry */
     ST_INSTALL |= APXCMDOPT_FOUND;



Mime
View raw message