diff options
| author | Michael Brown | 2007-01-12 00:45:18 +0100 |
|---|---|---|
| committer | Michael Brown | 2007-01-12 00:45:18 +0100 |
| commit | 7bf94b5ad698dd053a0625f309a2e311e581d177 (patch) | |
| tree | fd9b0480ff04162cd6de272e24a574df7fadb6c4 | |
| parent | Provide registration mechanism for loaded images, so that we can e.g. (diff) | |
| download | ipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.tar.gz ipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.tar.xz ipxe-7bf94b5ad698dd053a0625f309a2e311e581d177.zip | |
Allow for named images.
| -rw-r--r-- | src/core/image.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/image.c b/src/core/image.c index bfa91df33..d093e3a1d 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 ); |
