fixed check for empty string in installer

This commit is contained in:
Daniel Glanzmann
2008-09-29 20:12:30 +02:00
parent c25a0343d7
commit 7062cecd72
2 changed files with 2 additions and 3 deletions

View File

@@ -541,7 +541,7 @@ int main(int argc, char *argv[])
}
/* Copy restore file from cdrom */
if (unattended && !strcmp(restore_file, "")) {
if (unattended && (strlen(restore_file) > 0)) {
fprintf(flog, "unattended: Copy restore file\n");
snprintf(commandstring, STRING_SIZE,
"cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);

View File

@@ -147,13 +147,12 @@ int unattended_setup(struct keyvalue *unattendedkv) {
}
/* restore backup */
if (!strcmp(restore_file, "")) {
if (strlen(restore_file) > 0) {
fprintf(flog, "unattended: Restoring Backup\n");
snprintf(commandstring, STRING_SIZE,
"cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file);
if (mysystem(commandstring)) {
errorbox("unattended: ERROR restoring backup");
return 0;
}
}