Index: backend/comics/comics-document.c
===================================================================
--- backend/comics/comics-document.c	(revisión: 3287)
+++ backend/comics/comics-document.c	(copia de trabajo)
@@ -124,12 +124,28 @@
 	/* FIXME, use proper cbr/cbz mime types once they're
 	 * included in shared-mime-info */
 	if (!strcmp (mime_type, "application/x-cbr") ||
-	    !strcmp (mime_type, "application/x-rar")) {
-		comics_document->extract_command =
-			g_strdup ("unrar p -c- -ierr");
-		list_files_command =
-			g_strdup_printf ("unrar vb -c- -- %s", quoted_file);
-		comics_document->regex_arg = FALSE;
+	    !strcmp (mime_type, "application/x-rar")) {	    
+	    gchar *file_path_str = NULL;
+		file_path_str = g_find_program_in_path ("unrar");
+
+		if (file_path_str != NULL) {
+		   g_free (file_path_str);
+		   comics_document->extract_command =
+			   g_strdup ("unrar p -c- -ierr");
+		   list_files_command =
+			   g_strdup_printf ("unrar vb -c- -- %s", quoted_file);
+        }
+        else {
+            g_spawn_command_line_sync (g_strdup_printf ("unrar-free -xf %s /tmp",quoted_file),
+					     NULL, NULL, NULL, error);
+			comics_document->extract_command =
+			   g_strdup ("cat /tmp/");
+			   //g_strdup ("unrar p -c- -ierr");
+			list_files_command =
+			   g_strdup_printf ("unrar-free t %s", quoted_file); //| grep ^[[:space:]][[:alnum:]] | sed s/[[:space:]]//", quoted_file);                         
+			   //g_strdup_printf ("unrar vb -c- -- %s", quoted_file);
+        }
+		comics_document->regex_arg = FALSE;	
 	} else if (!strcmp (mime_type, "application/x-cbz") ||
 		   !strcmp (mime_type, "application/x-zip")) {
 		comics_document->extract_command =
@@ -144,7 +160,7 @@
 			g_strdup_printf ("7zr l -- %s", quoted_file);
 		comics_document->regex_arg = TRUE;
 	}
-
+	
 	g_free (mime_type);
 	g_free (quoted_file);
 
@@ -491,12 +507,17 @@
 		quoted_filename = g_shell_quote (
 			g_slist_nth_data (comics_document->page_names, page));
 	}
-
-	command_line = g_strdup_printf ("%s -- %s %s",
+	if (!strcmp(comics_document->extract_command,"cat /tmp/")){
+	   command_line = g_strdup_printf ("%s%s",
 					comics_document->extract_command,
+					quoted_filename);	
+	}
+	else {
+	   command_line = g_strdup_printf ("%s -- %s %s",
+					comics_document->extract_command,
 					quoted_archive,
 					quoted_filename);
-
+	}
 	g_shell_parse_argv (command_line, NULL, &argv, &err);
 	
 	if (err) {
