[Box Backup-dev] COMMIT r568 - box/chris/general/bin/bbackupd

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Tue, 16 May 2006 17:03:49 +0000 (GMT)


Author: chris
Date: 2006-05-16 17:03:42 +0000 (Tue, 16 May 2006)
New Revision: 568

Modified:
   box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp
   box/chris/general/bin/bbackupd/bbackupd.cpp
Log:
* bin/bbackupd/bbackupd.cpp
* bin/bbackupd/Win32ServiceFunctions.cpp
- Fixed handling of service installation where the configuration file is
  specified and the path contains spaces


Modified: box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp
===================================================================
--- box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp	2006-05-10 19:24:00 UTC (rev 567)
+++ box/chris/general/bin/bbackupd/Win32ServiceFunctions.cpp	2006-05-16 17:03:42 UTC (rev 568)
@@ -223,8 +223,9 @@
 
 	if (pConfigFileName != NULL)
 	{
-		cmdWithArgs += " ";
+		cmdWithArgs += " \"";
 		cmdWithArgs += pConfigFileName;
+		cmdWithArgs += "\"";
 	}
 
 	SC_HANDLE newService = CreateService(

Modified: box/chris/general/bin/bbackupd/bbackupd.cpp
===================================================================
--- box/chris/general/bin/bbackupd/bbackupd.cpp	2006-05-10 19:24:00 UTC (rev 567)
+++ box/chris/general/bin/bbackupd/bbackupd.cpp	2006-05-16 17:03:42 UTC (rev 568)
@@ -53,7 +53,7 @@
 	}
 
 	bool runAsWin32Service = false;
-	if ((argc == 2 || argc == 3) && ::strcmp(argv[1], "--service") == 0)
+	if (argc >= 2 && ::strcmp(argv[1], "--service") == 0)
 	{
 		runAsWin32Service = true;
 	}
@@ -81,7 +81,7 @@
 		syslog(LOG_INFO, "Box Backup service starting");
 
 		char* config = NULL;
-		if (argc == 3)
+		if (argc >= 3)
 		{
 			config = strdup(argv[2]);
 		}