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

boxbackup-dev@fluffy.co.uk boxbackup-dev@fluffy.co.uk
Sun, 20 Aug 2006 01:47:06 +0100


Author: chris
Date: 2006-08-20 01:47:06 +0100 (Sun, 20 Aug 2006)
New Revision: 800

Modified:
   box/chris/general/bin/bbackupd/BackupClientDirectoryRecord.cpp
Log:
* bin/bbackupd/BackupClientDirectoryRecord.cpp
- Fixed MakeFullPath() to handle zero-length directory name
- Changed assignments back to copy constructors
- Fixed accidental white space changes to reduce diff


Modified: box/chris/general/bin/bbackupd/BackupClientDirectoryRecord.cpp
===================================================================
--- box/chris/general/bin/bbackupd/BackupClientDirectoryRecord.cpp	2006-08-20 00:36:13 UTC (rev 799)
+++ box/chris/general/bin/bbackupd/BackupClientDirectoryRecord.cpp	2006-08-20 00:47:06 UTC (rev 800)
@@ -107,7 +107,8 @@
 {
 	std::string result;
 
-	if (rDir[rDir.size()-1] == DIRECTORY_SEPARATOR_ASCHAR)
+	if (rDir.size() > 0 && 
+		rDir[rDir.size()-1] == DIRECTORY_SEPARATOR_ASCHAR)
 	{
 		result = rDir + rFile;
 	}
@@ -289,10 +290,10 @@
 					#endif
 					continue;
 				}
-
+				
 				// Here if the object is something to back up (file, symlink or dir, not excluded)
 				// So make the information for adding to the checksum
-
+				
 				#ifdef WIN32
 				if(::lstat(filename.c_str(), &st) != 0)
 				{
@@ -306,7 +307,6 @@
 				}
 				#endif
 
-
 				checksum_info.mModificationTime = FileModificationTime(st);
 				checksum_info.mAttributeModificationTime = FileAttrModificationTime(st);
 				checksum_info.mSize = st.st_size;
@@ -562,7 +562,7 @@
 		f != rFiles.end(); ++f)
 	{
 		// Filename of this file
-		std::string filename = MakeFullPath(rLocalPath, *f);
+		std::string filename(MakeFullPath(rLocalPath, *f));
 
 		// Get relevant info about file
 		box_time_t modTime = 0;
@@ -909,7 +909,7 @@
 		d != rDirs.end(); ++d)
 	{
 		// Get the local filename
-		std::string dirname = MakeFullPath(rLocalPath, *d);		
+		std::string dirname(MakeFullPath(rLocalPath, *d));
 	
 		// See if it's in the listing (if we have one)
 		BackupStoreFilenameClear storeFilename(*d);