summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarin Adler <darin@src.gnome.org>2001-03-06 20:56:59 +0000
committerDarin Adler <darin@src.gnome.org>2001-03-06 20:56:59 +0000
commit03d57c2e849f35a29d9d35a32e3041275fb6db75 (patch)
treec7482df8dd215feb5271a22b2bd207e0cb38cdce
parentfd83675644a59924c9d04db8b21316ec2529f1e5 (diff)
downloadyelp-03d57c2e849f35a29d9d35a32e3041275fb6db75.tar.gz
Fixed bug 7328 (info pages no longer work): * components/help/converters/gnome-info2html2/main.c: (main): Fixed broken logic for handling both bzip and gzip. Fixed case when you change "View As" before the view change is complete. * src/nautilus-window-manage-views.c: (nautilus_window_set_content_view): Stop the view change if you make a change with the "View As" menu.
-rw-r--r--src/info2html/main.c88
1 files changed, 49 insertions, 39 deletions
diff --git a/src/info2html/main.c b/src/info2html/main.c
index 63334df3..33813973 100644
--- a/src/info2html/main.c
+++ b/src/info2html/main.c
@@ -44,9 +44,9 @@ int
main(int argc, char **argv)
{
gzFile f = NULL;
+ int bz = 0;
#ifdef HAVE_LIBBZ2
BZFILE *bf=NULL;
- int bz = 0;
#endif
char line[250];
poptContext ctx;
@@ -168,47 +168,57 @@ main(int argc, char **argv)
/* No need to store all nodes, etc since we let web server */
/* handle resolving tags! */
for (;1 || !foundit || !requested_nodename;) {
-#ifdef HAVE_LIBBZ2
- if(bz && !bf) {
- if(args && args[curarg])
- {
- bf = bzopen(args[curarg++], "r");
- if(!f)
- break;
- num_files_left = args[curarg]?1:0;
- for(work_line_number = 0, bzread(bf, line, sizeof(line)); *line != INFO_COOKIE;
- bzread(bf, line, sizeof(line)), work_line_number++)
- /**/ ;
- }
- else
- break;
- }
- if(!bzread(bf, line, sizeof(line)))
+ if(bz)
{
- bzclose(bf);
- bf = NULL;
- continue;
- }
+#ifdef HAVE_LIBBZ2
+ if(!bf)
+ {
+ if(args && args[curarg])
+ {
+ bf = bzopen(args[curarg++], "r");
+ if(!f)
+ break;
+ num_files_left = args[curarg]?1:0;
+ for(work_line_number = 0, bzread(bf, line, sizeof(line)); *line != INFO_COOKIE;
+ bzread(bf, line, sizeof(line)), work_line_number++)
+ /**/ ;
+ }
+ else
+ break;
+ }
+ if(!bzread(bf, line, sizeof(line)))
+ {
+ bzclose(bf);
+ bf = NULL;
+ continue;
+ }
+#else
+ g_assert_not_reached();
#endif
- if(!f) {
- if(args && args[curarg])
- {
- f = gzopen(args[curarg++], "r");
- if(!f)
- break;
- num_files_left = args[curarg]?1:0;
- for(work_line_number = 0, gzgets(f, line, sizeof(line)); *line != INFO_COOKIE;
- gzgets(f, line, sizeof(line)), work_line_number++)
- /**/ ;
- }
- else
- break;
- }
- if(!gzgets(f, line, sizeof(line)))
+ }
+ else
{
- gzclose(f);
- f = NULL;
- continue;
+ if(!f)
+ {
+ if(args && args[curarg])
+ {
+ f = gzopen(args[curarg++], "r");
+ if(!f)
+ break;
+ num_files_left = args[curarg]?1:0;
+ for(work_line_number = 0, gzgets(f, line, sizeof(line)); *line != INFO_COOKIE;
+ gzgets(f, line, sizeof(line)), work_line_number++)
+ /**/ ;
+ }
+ else
+ break;
+ }
+ if(!gzgets(f, line, sizeof(line)))
+ {
+ gzclose(f);
+ f = NULL;
+ continue;
+ }
}
work_line_number++;