aboutsummaryrefslogtreecommitdiffstats
path: root/icemulti
diff options
context:
space:
mode:
authorRoland Lutz <rlutz@hedmen.org>2017-07-11 19:01:11 +0200
committerRoland Lutz <rlutz@hedmen.org>2017-09-04 20:14:45 +0200
commitd1bfc4543e780a50694037bfb2a38fdca9178eae (patch)
tree0290dbf268fe334161635b4b0af8ab259c2c6e71 /icemulti
parentdd9ce3fcb5571d70e4ac7e17db58a797835572d1 (diff)
downloadicestorm-d1bfc4543e780a50694037bfb2a38fdca9178eae.tar.gz
icestorm-d1bfc4543e780a50694037bfb2a38fdca9178eae.tar.bz2
icestorm-d1bfc4543e780a50694037bfb2a38fdca9178eae.zip
icemulti: Re-use images
Diffstat (limited to 'icemulti')
-rw-r--r--icemulti/icemulti.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/icemulti/icemulti.cc b/icemulti/icemulti.cc
index 7bfe25e..65ae6b6 100644
--- a/icemulti/icemulti.cc
+++ b/icemulti/icemulti.cc
@@ -247,10 +247,18 @@ int main(int argc, char **argv)
while (optind != argc) {
if (header_count >= NUM_IMAGES)
error("Too many images supplied\n");
- images[image_count].reset(new Image(argv[optind++]));
+ for (int i = 0; i < image_count; i++)
+ if (strcmp(argv[optind], images[i]->filename) == 0) {
+ header_images[header_count] = &*images[i];
+ goto image_found;
+ }
+ images[image_count].reset(new Image(argv[optind]));
header_images[header_count] = &*images[image_count];
- header_count++;
image_count++;
+
+ image_found:
+ header_count++;
+ optind++;
}
if (coldboot && por_image != 0)