fixes in zip logic

This commit is contained in:
p.kosyh 2010-06-18 08:35:16 +00:00
parent 45c8f3ab23
commit 2c8c66b4d7

View file

@ -224,8 +224,6 @@ const char *password;
char c = *(filename_withoutpath - 1); char c = *(filename_withoutpath - 1);
*(filename_withoutpath - 1) = '\0'; *(filename_withoutpath - 1) = '\0';
makedir(write_filename); makedir(write_filename);
if (!*zip_game_dirname)
strcpy(zip_game_dirname, filename_inzip);
*(filename_withoutpath - 1) = c; *(filename_withoutpath - 1) = c;
fout = fopen64(write_filename, "wb"); fout = fopen64(write_filename, "wb");
} }
@ -235,6 +233,12 @@ const char *password;
} }
} }
if ((filename_withoutpath != (char *)filename_inzip) &&
!*zip_game_dirname) {
strcpy(zip_game_dirname, filename_inzip);
zip_game_dirname[strcspn(zip_game_dirname,"/\\")] = 0;
}
if (!*zip_game_dirname) { if (!*zip_game_dirname) {
err = -1; err = -1;
fprintf(stderr, "No dir in zip...\n"); fprintf(stderr, "No dir in zip...\n");