[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] Empty Datafile Bug
- From: <happysad@xxxxxxxxxx>
- Date: Sat, 23 Apr 2005 07:45:19 -0400
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=nKICNevqQdrD22OSgoquIMmg+an/Y41kqAVNATbqJ4aVja0SyORZO+8CP/2FEEbIvWpyQaoQC+UuHq7yPyciY0sVWwG4TGMCOXRqkSJft2LGvVSZqhtAJd6HogDCsisqMWn9oDGvWwZbUxRDuCdFTQbFhk7q0/n39gY3FgJw+Ko=
Please don't commit
this without having someone taking a good look. Attached is
a small patch for datafile.c. I noticed that empty datafiles
within a datafile result in the empty one being turned into a
DAT_END. Here's an example; I hope you're viewing with a
mono-spaced font:
FILE - File1
FILE |- File2 <-- Problem
BMP |- Bitmap
As
a DAT_END, File2 prevents access to the bitmap. The attached
patch circumvents this with an explicit check for empty datafiles in
load_file_object. If one is found, a FILE is created just
for the property set--no data. I chose not to call
load_object on this file, as it didn't fit well into the loop and I'm
not sure how safe it would be. The assignments are simple.
No warnings were generated by the patch. I tested with a datafile and experienced no problems.
- Grady
Relevant Allegro.cc thread: http://www.allegro.cc/forums/view_thread.php?_id=483695 Attachment:
datafile.c.diff
Description: Binary data