summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 00:45:18 +0100
committerMichael Brown2007-01-12 00:45:18 +0100
commit7bf94b5ad698dd053a0625f309a2e311e581d177 (patch)
treefd9b0480ff04162cd6de272e24a574df7fadb6c4 /src/core/image.c
parentProvide registration mechanism for loaded images, so that we can e.g. (diff)
downloadipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.tar.gz
ipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.tar.xz
ipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.zip
Allow for named images.
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c8
1 files 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 );