MO and ZIP: Fix return length of READ 6/10/12 and actually save the image history into the configuration file.
This commit is contained in:
26
src/config.c
26
src/config.c
@@ -3011,6 +3011,19 @@ save_other_removable_devices(void)
|
||||
else
|
||||
ini_section_set_string(cat, temp, zip_drives[c].image_path);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
sprintf(temp, "zip_%02i_image_history_%02i", c + 1, i + 1);
|
||||
if ((zip_drives[c].image_history[i] == 0) || strlen(zip_drives[c].image_history[i]) == 0)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else {
|
||||
path_normalize(zip_drives[c].image_history[i]);
|
||||
if (!strnicmp(zip_drives[c].image_history[i], usr_path, strlen(usr_path)))
|
||||
ini_section_set_string(cat, temp, &zip_drives[c].image_history[i][strlen(usr_path)]);
|
||||
else
|
||||
ini_section_set_string(cat, temp, zip_drives[c].image_history[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (c = 0; c < MO_NUM; c++) {
|
||||
@@ -3054,6 +3067,19 @@ save_other_removable_devices(void)
|
||||
else
|
||||
ini_section_set_string(cat, temp, mo_drives[c].image_path);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
sprintf(temp, "mo_%02i_image_history_%02i", c + 1, i + 1);
|
||||
if ((mo_drives[c].image_history[i] == 0) || strlen(mo_drives[c].image_history[i]) == 0)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else {
|
||||
path_normalize(mo_drives[c].image_history[i]);
|
||||
if (!strnicmp(mo_drives[c].image_history[i], usr_path, strlen(usr_path)))
|
||||
ini_section_set_string(cat, temp, &mo_drives[c].image_history[i][strlen(usr_path)]);
|
||||
else
|
||||
ini_section_set_string(cat, temp, mo_drives[c].image_history[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ini_delete_section_if_empty(config, cat);
|
||||
|
||||
Reference in New Issue
Block a user