Reading post "r13/r1/r1/r1/r1/1" [Mail Boardmaster] [Main] [Help]
SUBJECT: RE:RE:RE:RE:links & RT
On Fri, Jan. 4, 2002 - 19:17:05, rick wrote:

| PROBLEM:
| In the links source code, view.c file, the encode_textarea()
| procedure does a conversion from "\n" to "\r\n". The problem is
| that it gets executed twice!
|
| SOLUTION:
| I don't know the inner working of links so I won't
| just arbitrarily remove one. However, if I add a
| "check-if-textarea-is-encoded", it seems to work just fine. Here
| is the modification to links 0.96 (latest) in the "view.c"
| file. Replace the encode_textarea procedure in line 1054 with
| this:
|
| unsigned char *encode_textarea(unsigned char *t)
| {
| int len =0;
| int encoded_already;
| unsigned char *o =init_str();
| encoded_already=(int)strchr(t,'\r');
| for (; *t; t++) {
| /*
| if (*t !='\n') add_chr_to_str(&o, &len, *t);
| else add_to_str(&o, &len, "\r\n");
| */
| if((*t !='\n')||encoded_already) add_chr_to_str(&o, &len, *t);
| else add_to_str(&o, &len, "\r\n");
| }
| return o;
| }

Hmm. Were you able to actually see the CRCRLF screwup?

I do something that sounds similar to your par thingy. A cgi
script that goes in cgi-bin and echoes back QUERY_STRING and so
on. I brought your RT test message (ignore this msg..) to my
machine and changed the form action to point to this script and
replied to your msg with some additional typed-in stuff and it
looks OK,

User-27s+name-3A-0D-0A-3E+User-27s+phone-3A-0D-0A-3E+User

(minus swapped for percent...hope it doesn't get eaten)

I see what you're doing. encode_textarea expects
linefeed-delimited data and instead gets CRLF so it steps
over the CR and switches CRLF for the LF.

I'm obviously missing something since if I use Netscape with
the above procedure, the exact same data is returned by the cgi
script. Yet RT double-spaces link's effort and not Netscape's.

Rick
--

Include text of this message
with your response
(No Next Message)