|
@@ -148,9 +148,13 @@ static int script_exec ( struct image *image ) {
|
148
|
148
|
rc = process_script ( image, script_exec_line,
|
149
|
149
|
terminate_on_exit_or_failure );
|
150
|
150
|
|
151
|
|
- /* Restore saved state, re-register image, and return */
|
|
151
|
+ /* Restore saved state */
|
152
|
152
|
script_offset = saved_offset;
|
153
|
|
- register_image ( image );
|
|
153
|
+
|
|
154
|
+ /* Re-register image (unless we have been replaced) */
|
|
155
|
+ if ( ! image->replacement )
|
|
156
|
+ register_image ( image );
|
|
157
|
+
|
154
|
158
|
return rc;
|
155
|
159
|
}
|
156
|
160
|
|