wrc: Avoid a crash if a file didn't contain any resources.

This commit is contained in:
Alexandre Julliard 2009-07-16 11:15:00 +02:00
parent 1eab4f2f3d
commit 5d56995696
1 changed files with 9 additions and 7 deletions

View File

@ -386,15 +386,17 @@ resource_file
$1 = rsc;
/* Final statements before were done */
head = get_resource_head($1);
if (resource_top) /* append to existing resources */
if ((head = get_resource_head($1)) != NULL)
{
resource_t *tail = resource_top;
while (tail->next) tail = tail->next;
tail->next = head;
head->prev = tail;
if (resource_top) /* append to existing resources */
{
resource_t *tail = resource_top;
while (tail->next) tail = tail->next;
tail->next = head;
head->prev = tail;
}
else resource_top = head;
}
else resource_top = head;
sttres = NULL;
}
;