lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH 2.8.5-pre4] Binary mode required


From: Ilya Zakharevich
Subject: lynx-dev [PATCH 2.8.5-pre4] Binary mode required
Date: Wed, 4 Feb 2004 11:45:15 -0800
User-agent: Mutt/1.4i

When lynx handles a file to an external program (e.g., you click on a
jpeg file), it writes a copy with input file in a text mode.

(HTLoadFile() opens in text mode unless gzip/bzip2; then it gives it
to HTParseFile(), which calls HTFileCopy().)  What follows is a
horrible hack, but I do not understand the details good enough to
deduce enough info to open file in binary mode...

Enjoy,
Ilya

--- ./WWW/Library/Implementation/HTFormat.c~    Wed Jan  7 18:03:08 2004
+++ ./WWW/Library/Implementation/HTFormat.c     Wed Feb  4 11:24:14 2004
@@ -871,6 +871,12 @@ PUBLIC int HTFileCopy ARGS2(
     */
     targetClass = *(sink->isa); /* Copy pointers to procedures */
 
+#ifdef __EMX__ /* Should be done for others too, but the API is not portable */
+    /* XXXX A horrible hack; this should have been done earlier... */
+    if (0 == strcmp(targetClass.name, "FileWriter"))
+       _fsetmode(fp,"b");
+#endif
+
     /* Push binary from socket down sink
     */
     HTReadProgress(bytes = 0, 0);

; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]