diff options
-rw-r--r-- | src/core/image.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/image.c b/src/core/image.c index ce8cf868b..3e236ca60 100644 --- a/src/core/image.c +++ b/src/core/image.c @@ -338,9 +338,12 @@ int image_exec ( struct image *image ) { /* Sanity check */ assert ( image->flags & IMAGE_REGISTERED ); - /* Switch current working directory to be that of the image itself */ + /* Switch current working directory to be that of the image + * itself, if applicable + */ old_cwuri = uri_get ( cwuri ); - churi ( image->uri ); + if ( image->uri ) + churi ( image->uri ); /* Preserve record of any currently-running image */ saved_current_image = current_image; |