Index: textpattern-importer.php
===================================================================
--- textpattern-importer.php	(revision 1160955)
+++ textpattern-importer.php	(working copy)
@@ -40,6 +40,26 @@
 	}
 }
 
+if(!function_exists('get_comment_ID'))
+{
+	/**
+	 * Get the comment count for posts.
+	 *
+	 * @package WordPress
+	 * @subpackage Textpattern_Import
+	 *
+	 * @param int $post_ID Post ID
+	 * @return int
+	 */
+	function get_comment_ID($comment_author, $comment_date)
+	{
+		global $wpdb;
+		$comment_author = stripslashes($comment_author);
+		$comment_date = stripslashes($comment_date);
+		return $wpdb->get_var( $wpdb->prepare("SELECT comment_ID FROM $wpdb->comments WHERE comment_author = %s AND comment_date = %s", $comment_author, $comment_date) );
+	}
+}
+
 if(!function_exists('link_exists'))
 {
 	/**
@@ -426,9 +446,9 @@
 							'comment_approved'	=> $comment_approved);
 				$comment = wp_filter_comment($comment);
 
-				if ( $cinfo = comment_exists($name, $posted) ) {
+				if ( comment_exists($name, $posted) ) {
 					// Update comments
-					$comment['comment_ID'] = $cinfo;
+					$comment['comment_ID'] = get_comment_ID($name, $posted);
 					$ret_id = wp_update_comment($comment);
 				} else {
 					// Insert comments
