From 2d416efeb6400651777f698b4f8b5a3ecc7b7e6a Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Thu, 25 Sep 2008 00:18:06 +0000 Subject: [PATCH] convert_msg_header() fixes: Reference the header field name (f) correctly (copy/pasted "line" from newsutil.js). Removed unnecessary reassignment of header field array element. Return newly created object instead of adding properties to passed array. Can you tell I'm not actually testing these modifications? :-) --- exec/load/mailproc_util.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/exec/load/mailproc_util.js b/exec/load/mailproc_util.js index e16b3fe482..b98c1eacf0 100644 --- a/exec/load/mailproc_util.js +++ b/exec/load/mailproc_util.js @@ -31,10 +31,12 @@ function parse_msg_header(msgtxt) } // Convert a parsed RFC822 message header field array into a Synchronet-compatible header object -function convert_msg_header(hdr) +function convert_msg_header(hdr_array) { - for(f in hdr) { - var data = hdr[f]; + var hdr = new Object; + + for(f in hdr_array) { + var data = hdr_array[f]; switch(f) { case "to": case "apparently-to": @@ -101,10 +103,9 @@ function convert_msg_header(hdr) hdr.field_list=new Array(); hdr.field_list.push( { type: RFC822HEADER, - data: line + ": " + data + data: f + ": " + data } ); - hdr[line.toLowerCase()]=data; break; } } -- GitLab