summaryrefslogtreecommitdiffstats
path: root/src/core/image.c
diff options
context:
space:
mode:
authorSimon Rettberg2024-04-12 14:52:06 +0200
committerSimon Rettberg2024-04-12 14:52:06 +0200
commit2ae76865d3d109712f9ee488cbc19bd107bbc9ab (patch)
tree36e7310eb089cf7fd3496e5c32c70981e447f235 /src/core/image.c
parentMerge branch 'aqc1xx' into openslx (diff)
parent[netdevice] Add "linktype" setting (diff)
downloadipxe-openslx.tar.gz
ipxe-openslx.tar.xz
ipxe-openslx.zip
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/core/image.c')
-rw-r--r--src/core/image.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/image.c b/src/core/image.c
index 3e65b5ed..bf0e4f75 100644
--- a/src/core/image.c
+++ b/src/core/image.c
@@ -134,10 +134,13 @@ int image_set_uri ( struct image *image, struct uri *uri ) {
int rc;
/* Set name, if image does not already have one */
- if ( uri->path && ( ! ( image->name && image->name[0] ) ) ) {
- name = basename ( ( char * ) uri->path );
- if ( ( rc = image_set_name ( image, name ) ) != 0 )
- return rc;
+ if ( ! ( image->name && image->name[0] ) ) {
+ name = ( uri->path ? uri->path : uri->opaque );
+ if ( name ) {
+ name = basename ( ( char * ) name );
+ if ( ( rc = image_set_name ( image, name ) ) != 0 )
+ return rc;
+ }
}
/* Update image URI */