]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
fixed check for empty string in installer
authorDaniel Glanzmann <dg@ipfire.org>
Mon, 29 Sep 2008 18:12:30 +0000 (20:12 +0200)
committerDaniel Glanzmann <dg@ipfire.org>
Mon, 29 Sep 2008 18:12:30 +0000 (20:12 +0200)
src/install+setup/install/main.c
src/install+setup/install/unattended.c

index bf8f5b2bd762ea14e181bde949bb92ea7efb2dd5..52b0402984050b6414acb459e3f4b550c95ec6b1 100644 (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);
index 8dc4882a31d6a0dce21a32e85f362e11e9c6ab7d..5bec24f0e2d5a1b3594c4e66fcfde1c284575372 100644 (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;
            }
        }