Index: /FCKeditor/trunk/_dev/releaser/fckreleaser.php
===================================================================
--- /FCKeditor/trunk/_dev/releaser/fckreleaser.php	(revision 2244)
+++ /FCKeditor/trunk/_dev/releaser/fckreleaser.php	(revision 2245)
@@ -82,8 +82,8 @@
 {
 	$dirPath = str_replace( '\\', '/', $dirPath ) ;
-
+	
 	if ( substr( $dirPath, -1, 1 ) != '/' )
 		$dirPath .= '/' ;
-
+	
 	return $dirPath ;
 }
@@ -170,5 +170,5 @@
 		if ( isset( $releaseNode->Children[ 'IGNOREFILE' ] ) )
 		{
-			$ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ;
+			$ignoreNodes = $releaseNode->Children[ 'IGNOREFILE' ] ;	
 			foreach ( $ignoreNodes as $ignoreNode )
 			{
@@ -181,8 +181,8 @@
 		if ( isset( $releaseNode->Children[ 'ORIGINALFILE' ] ) )
 		{
-			$originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ;
+			$originalNodes = $releaseNode->Children[ 'ORIGINALFILE' ] ;	
 			foreach ( $originalNodes as $originalNode )
 			{
-				$this->OriginalFiles[] = (object)array(
+				$this->OriginalFiles[] = (object)array( 
 					'Source' => $originalNode->Attributes[ 'SOURCEPATH' ],
 					'Target' => $originalNode->Attributes[ 'TARGETPATH' ] ) ;
@@ -239,5 +239,5 @@
 		while ( $file = readdir( $sourceDirHandler ) )
 		{
-			// Skip ".", ".." and hidden fields (Unix).
+			// Skip ".", ".." and hidden fields (Unix). 
 			if ( substr( $file, 0, 1 ) == '.' )
 				continue ;
@@ -327,7 +327,7 @@
 		// Project start time (registration at SourceForge, actually = 2003-03-01 18:20).
 		$startTime = gmmktime( 18, 20, 0, 3, 1, 2003 ) ;
-
+		
 		$currentTime = time() ;
-
+		
 		// Get the number of seconds since the project startup.
 		$seconds = $currentTime - $startTime ;
@@ -597,14 +597,14 @@
 		$script = $stringsProc->ProtectStrings( $script ) ;
 
+		// Remove "/* */" comments
+		$script = preg_replace(
+			'/(?<!\/)\/\*.*?\*\//s',
+			'', $script ) ;
+
 		// Remove "//" comments
 		$script = preg_replace(
-			'/\/\/.*$/m',
-			'', $script ) ;
-
-		// Remove "/* */" comments
-		$script = preg_replace(
-			'/(?m-s:^\s*\/\*).*?\*\//s',
-			'', $script ) ;
-
+				'/\/\/.*$/m',
+				'', $script ) ;
+		
 		// Remove spaces before the ";" at the end of the lines
 		$script = preg_replace(
@@ -966,4 +966,9 @@
 		}
 
+		// Fix invalid line breaks (must be all CRLF).
+		$data = preg_replace(
+			'/(?:(?<!\r)\n)|(?:\r(?!\n))/im',
+			"\r\n", $data ) ;
+
 		return $data ;
 	}
@@ -985,6 +990,7 @@
 	function ProtectStrings( $source )
 	{
+		// Catches string literals, regular expressions and conditional comments.
 		return preg_replace_callback(
-			'/(?:("|\').*?(?<!\\\\)\1|(?<![\/\\\\])\/[^\/\*].*?(?<!\\\\)\/)/',
+			'/(?:("|\').*?(?<!\\\\)\1)|(?:(?<![\*\/\\\\])\/[^\/\*].*?(?<!\\\\)\/(?=([\.\w])|(\s*[,;}\)])))|(?s:\/\*@(?:cc_on|if|elif|else|end).*?@\*\/)/',
 			array( &$this, '_ProtectStringsMatch' ), $source ) ;
 	}
