Skip to content

Commit 1bc46b4

Browse files
committed
Fix multiple ISOs extraction (fixes XboxDev#85)
1 parent 36a9a1f commit 1bc46b4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extract-xiso.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,14 +1179,14 @@ int decode_xiso( char *in_xiso, char *in_path, modes in_mode, char **out_iso_pat
11791179
}
11801180

11811181
if (!err && in_mode == k_extract) {
1182+
if ((cwd = getcwd(NULL, 0)) == NULL) mem_err();
11821183
if (in_path) {
1183-
if (strlen(in_path) == 0) misc_err("empty destination path");
1184-
if (!err && (cwd = getcwd(NULL, 0)) == NULL) mem_err();
1184+
if (!err && strlen(in_path) == 0) misc_err("empty destination path");
11851185
if (!err && mkdir(in_path, 0755) == -1) mkdir_err(in_path);
11861186
if (!err && chdir(in_path) == -1) chdir_err(in_path);
11871187
}
11881188
else {
1189-
if (strlen(iso_name) == 0) misc_err("invalid xiso image name: %s", in_xiso);
1189+
if (!err && strlen(iso_name) == 0) misc_err("invalid xiso image name: %s", in_xiso);
11901190
if (!err && mkdir(iso_name, 0755) == -1) mkdir_err(iso_name);
11911191
if (!err && chdir(iso_name) == -1) chdir_err(iso_name);
11921192
}

0 commit comments

Comments
 (0)