From 7bf94b5ad698dd053a0625f309a2e311e581d177 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Jan 2007 23:45:18 +0000 Subject: [PATCH] Allow for named images. --- src/core/image.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/image.c b/src/core/image.c index bfa91df3..d093e3a1 100644 --- a/src/core/image.c +++ b/src/core/image.c @@ -49,9 +49,11 @@ static struct image_type image_types_end[0] int register_image ( struct image *image ) { static unsigned int imgindex = 0; - /* Create image name */ - snprintf ( image->name, sizeof ( image->name ), "img%d", - imgindex++ ); + /* Create image name if it doesn't already have one */ + if ( ! image->name[0] ) { + snprintf ( image->name, sizeof ( image->name ), "img%d", + imgindex++ ); + } /* Add to image list */ list_add_tail ( &image->list, &images );