 					{
 						//add these folders after everything else because we'll
 						//use the -C option
-						selfFolders.push(srcFile);
+						cOptionFolders.push(new FolderToAddWithCOption(srcFile, null));
 						continue;
 					}
-					else if(destPath == path.basename(srcFile))
+					else if(destPath == ".")
 					{
 						//add these folders after everything else because we'll
 						//use the -C option
-						selfFolders.push(srcFile);
+						cOptionRootFolders.push(srcFile);
 						continue;
 					}
-					else if(destPath == ".")
+					else if(canUseCOptionForFolder(srcFile, destPath))
 					{
 						//add these folders after everything else because we'll
 						//use the -C option
-						rootFolders.push(srcFile);
+						cOptionFolders.push(new FolderToAddWithCOption(srcFile, destPath));
 						continue;
 					}
 				}

				}
				addFile(srcFile, destPath, result);
			}
			count = rootFolders.length;
			for(i = 0; i < count; i++)
			{
				folder = rootFolders[i];
				result.push("-C");
				result.push(folder);
				result.push(".");
			}
			count = selfFolders.length;
			for(i = 0; i < count; i++)
			{
				var folder:String = selfFolders[i];
				result.push("-C");
				result.push(path.dirname(folder));
				result.push(path.basename(folder));
			}
		}

		protected static function addFile(srcFile:String, destPath:String, result:Array):void


		protected static function parseFiles(files:Array, result:Array):void
		{
			var cOptionFolders:Array = [];
			var cOptionRootFolders:Array = [];
			var count:int = files.length;
			for(var i:int = 0; i < count; i++)
			{
