X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=backend%2Fcomics%2Fcomics-document.c;h=dc57cdd647a9353b1ff35dfad75be40750e8d7bb;hb=b329a61d561198cd405721372580d05476c2240a;hp=8928422830ed283f58d7da54e3853e5aefc9ea46;hpb=9cf5791a53cbd36dc9585f0cd641eb1438f738a6;p=evince.git diff --git a/backend/comics/comics-document.c b/backend/comics/comics-document.c index 89284228..dc57cdd6 100644 --- a/backend/comics/comics-document.c +++ b/backend/comics/comics-document.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include @@ -42,6 +42,16 @@ #include "ev-document-thumbnails.h" #include "ev-file-helpers.h" +#ifdef G_OS_WIN32 +/* On windows g_spawn_command_line_sync reads stdout in O_BINARY mode, not in O_TEXT mode. + * As a consequence, newlines are in a platform dependent representation (\r\n). This + * might be considered a bug in glib. + */ +#define EV_EOL "\r\n" +#else +#define EV_EOL "\n" +#endif + typedef enum { RARLABS, @@ -414,7 +424,8 @@ comics_document_load (EvDocument *document, } /* FIXME: is this safe against filenames containing \n in the archive ? */ - cb_files = g_strsplit (std_out, "\n", 0); + cb_files = g_strsplit (std_out, EV_EOL, 0); + g_free (std_out); if (!cb_files) { @@ -504,7 +515,7 @@ comics_document_get_page_size (EvDocument *document, guchar buf[1024]; gboolean success, got_size = FALSE; gint outpipe = -1; - GPid child_pid = -1; + GPid child_pid; gssize bytes; GdkPixbuf *pixbuf; gchar *filename; @@ -579,7 +590,7 @@ comics_document_render_pixbuf (EvDocument *document, guchar buf[4096]; gboolean success; gint outpipe = -1; - GPid child_pid = -1; + GPid child_pid; gssize bytes; gint width, height; gchar *filename;