rem: obj[format("part%u.crc32",part)]=format("%lx",pcrc32); 
add: obj[format("part%u.crc32",part)]=format("%08lxh",pcrc32); 
context: function add_part(list,sub_code,hdr				  ,fname,codec,part,total				  ,first_line,last_line				  ,begin,end,pcrc32,size,crc32){	if(part<1) {		/* must parse from subject (yuck) */		part=hdr.subject.lastIndexOf('(');		if(part>=0)			part=parseInt(hdr.subject.slice(part+1),10);		if(part<1) {			printf("!Failed to parse part number from: %s\r\n",hdr.subject);			return(false);		}		printf("Parsed part number: %u\r\n",part);	}	if(total==undefined || total<part) {	/* must parse from subject (yuck) */		total=hdr.subject.lastIndexOf('(');		if(total>=0) {			subject=hdr.subject.slice(total+1);			total=subject.indexOf('/');		}		if(total>=0)			total=parseInt(subject.slice(total+1),10);		if(total<part) {			printf("!Failed to parse total parts from: %s\r\n",hdr.subject);			return(false);		}		printf("Parsed total parts: %u\r\n",total);	}	/* Search database for existing file object */	var li;	for(li=0; li<list.length; li++)		if(list[li].name==fname && list[li].total==total && list[li].codec==codec			&& (size==undefined || list[li].size==size)			&& (crc32==undefined || parseInt(list[li].crc32,16)==crc32)			) {			printf("%s found in database\r\n",fname.toString());			break;		}	obj=list[li];	var time_str = system.timestr();	var time_hex = format("%lx",time());	if(obj==undefined)	{	/* new entry */		printf("New parts database entry for: %s\r\n",fname.toString());		printf("total=%u, size=%u, crc32=%lx\r\n",total,size,crc32);		obj = { name: fname, codec: codec, parts: 0, total: total };		obj.subject=hdr.subject;	/* save first subject for additional UUE parts */		obj.from=hdr.from;		/* yEnc file fields */		if(size!=undefined)			obj.size=size;		if(crc32!=undefined)			obj.crc32=format("%lx",crc32);		/* Timestamp */		obj.created=time_str;		obj.created_time=time_hex	}	/* Timestamp */	obj.updated=time_str;	obj.updated_time=time_hex;	/* part message info */	prop=format("part%u.id",part);	if(obj[prop]!=undefined) {		printf("Part %u of %s already in database\r\n",part,fname.toString());		return(true);	// pretend we added it	}	printf("Adding part %u of %s-encoded file to database:\r\n",part,codec.toUpperCase());	printf("File: %s\r\n",fname);	obj[format("part%u.id",part)]=hdr.id;	obj[format("part%u.sub",part)]=sub_code;	obj[format("part%u.msg",part)]=hdr.number;	obj[format("part%u.date",part)]=hdr.date;	obj[format("part%u.added",part)]=time_str;	obj[format("part%u.added_time",part)]=time_hex;//	obj[format("part%u.from",part)]=hdr.from;//	obj[format("part%u.subject",part)]=hdr.subject;	/* These save us the hassle of parsing again later */	obj[format("part%u.first_line",part)]=first_line;	obj[format("part%u.last_line",part)]=last_line;	/* yEnc part fields */	if(begin!=undefined)		obj[format("part%u.begin",part)]=begin;	if(end!=undefined)		obj[format("part%u.end",part)]=end;	if(pcrc32!=undefined)		obj[format("part%u.crc32",part)]=format("%lx",pcrc32);	obj.parts++;	list[li]=obj;	printf("Part %u added (%u/%u parts in database)\r\n"		,part,obj.parts,obj.total);	return(true);}
meta: 9592	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9592/947ee486523c91cfaf8e1d7633293dac6d195c53/binarydecoder.js/buggy/binarydecoder.js