Closed Bug 61748 Opened 24 years ago Closed 24 years ago

signature file is truncated

Categories

(MailNews Core :: Composition, defect, P3)

DEC
OpenVMS
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: colin, Assigned: bugzilla)

Details

Attachments

(2 files)

After configuring a signature file, only the first line of text from that file 
is ever used. Is the first line is empty, then you don't see any text from the 
signature file (although you do still get the "--" at the end of the mail).
For the signature file to be completely read, it has to be in STREAM-LF format. 
If its in VARIABLE LENGTH format then only the first line is used. So the 
workaround is to convert your signature file to STREAM-LF format. For example:

$ create stmlf.fdl
RECORD
 FORMAT stream_lf
$ convert /fdl=stmlf old-sig.txt new-sig.txt
Status: NEW → ASSIGNED
The problem is this. The signature file is read using 
nsMsgCompose::LoadDataFromFile, and the way LoadDataFromFile is coded (see 
http://lxr.mozilla.org/seamonkey/source/mailnews/compose/src/nsMsgCompose.cpp#19
69), it only makes ONE read to the file. If it doesn't get the entire contents 
in that one read, then tough, the remainder is ignored. On OpenVMS, when reading 
 VARIABLE LENGTH format files, only one line is returned with each read 
operation. Hence the problem.

The correct fix (for all platforms since read does not guarantee to read all the 
requested characters in one operation) is to loop until either readSize chars 
are read or until EOF is hit (read returns 0).
Re-assigned to MailNews default owner. If you want me to submit a patch for this 
let me know.

Colin.
Assignee: colin → ducarroz
Status: ASSIGNED → NEW
patches are always welcome...
Attached patch patch for truckSplinter Review
Patches only tested on OpenVMS.
Status: NEW → ASSIGNED
Keywords: patch
Will look at it very soon...
I've just tested it on Mac and it works well, even when I simulate a read in
several part (like does apparently OpenVMS). R=ducarroz
Whiteboard: Fix in hand
sr=bienvenu
sr=mscott
Fixed and checked in. Thanks colin@theblakes.com for providing the patch.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: Fix in hand
Fix is in, no regression reported, VERIFIED.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: