Can't add more than one entry on OS/2

RESOLVED FIXED

Status

Calendar
Internal Components
--
major
RESOLVED FIXED
14 years ago
12 years ago

People

(Reporter: mkaply, Assigned: mkaply)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

1.27 KB, patch
Mostafa Hosseini
: first-review+
Details | Diff | Splinter Review
(Assignee)

Description

14 years ago
On OS/2 you can only add one entry.

I tracked down the problem to icalfileset.c.

The problem is that after a write, icalfileset truncates the file to the
returned size.

In the OS/2 case, the returned size is smaller than the actual file because we
use 0x0A 0x0D line endings.

I tried to fix this by taking the Windows case (which should work) but the
chsize crashed for some reason (we're investigating this with the OS/2 team)

So I had to add an OS/2 specific case that did ftruncate with the results of tell.
(Assignee)

Comment 1

14 years ago
Created attachment 147233 [details] [diff] [review]
Fix

Comment 2

14 years ago
Comment on attachment 147233 [details] [diff] [review]
Fix

r=mostafah
Attachment #147233 - Flags: first-review+
(Assignee)

Comment 3

14 years ago
Fix checked in.

I put it on the 1.7 branch as well.
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED

Comment 4

14 years ago
From looking at the diff alone, I think you are missing a #else after that 
#endif for the Mac check...

could be wrong though.  havent applied the patch, and don't have my computer 
with the source code on it at hand.
(Assignee)

Comment 5

14 years ago
Created attachment 147330 [details] [diff] [review]
Better fix

You are correct.

It still compiled so I missed.

I'm redoing this #ifdef group to be more readable. All these nested #ifndefs
are silly

if windows
do a
else if OS/2
do b
else if Mac
No ftruncate
else everyone else
ftruncate
end
Assignee: gray → mkaply
Attachment #147233 - Attachment is obsolete: true
Status: RESOLVED → ASSIGNED
Resolution: FIXED → ---

Comment 6

14 years ago
Comment on attachment 147330 [details] [diff] [review]
Better fix

r=mostafah
Attachment #147330 - Flags: first-review+
(Assignee)

Comment 7

14 years ago
OK, really fixed this time.

Sorry about that.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago14 years ago
Resolution: --- → FIXED

Updated

12 years ago
QA Contact: gurganbl → libical
Component: libical → Internal Components
The bugspam monkeys have been set free and are feeding on Calendar :: Internal Components. Be afraid for your sanity!
QA Contact: libical → base
You need to log in before you can comment on or make changes to this bug.