[Extractor-gtk-cvslog] SF.net SVN: extractor-gtk:[96] trunk/extractor/extractor.c
Extract files from unusual archive formats
Brought to you by:
someone-guy
From: <som...@us...> - 2008-08-22 16:08:23
|
Revision: 96 http://extractor-gtk.svn.sourceforge.net/extractor-gtk/?rev=96&view=rev Author: someone-guy Date: 2008-08-22 16:08:20 +0000 (Fri, 22 Aug 2008) Log Message: ----------- Reduce scope of another global variable Modified Paths: -------------- trunk/extractor/extractor.c Modified: trunk/extractor/extractor.c =================================================================== --- trunk/extractor/extractor.c 2008-08-22 16:07:59 UTC (rev 95) +++ trunk/extractor/extractor.c 2008-08-22 16:08:20 UTC (rev 96) @@ -30,7 +30,6 @@ }; static FILE *input_file = NULL; -static file_t *flist = NULL; static const fmt_desc_t *cur_fmt = NULL; int extract_file(const file_t *file, FILE *out) { @@ -42,6 +41,7 @@ } file_t *open_file(const char *fname, const fmt_desc_t *fmt) { + static file_t *flist = NULL; // close previous file and free its data if (cur_fmt && flist) cur_fmt->free_list(flist); @@ -83,6 +83,7 @@ int main(int argc, char *argv[]) { int fmt_idx = -1; int list_files = 0; + file_t *flist = NULL; if (argc > 1) { int pos = 1; @@ -121,7 +122,8 @@ return 1; } } - if (!open_file(argv[pos], fmt_idx >= 0 ? fmts[fmt_idx] : NULL)) { + flist = open_file(argv[pos], fmt_idx >= 0 ? fmts[fmt_idx] : NULL); + if (!flist) { fprintf(stderr, _("Could not open file %s\n"), argv[pos]); return 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |