man: fix handling of gzipped manpages
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Jun 2012 08:22:05 +0000 (10:22 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 8 Jun 2012 08:22:05 +0000 (10:22 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
miscutils/man.c

index 611466349c47c1a7f2b550eebb1188012f35018a..e380fdabaf2b984a58edde8ea57637173dae62bf 100644 (file)
@@ -129,27 +129,21 @@ static int show_manpage(const char *pager, char *man_filename, int man, int leve
 #endif
 #if ENABLE_FEATURE_SEAMLESS_XZ
        strcpy(ext, "xz");
-       if (run_pipe(pager, man_filename, man, level))
+       if (run_pipe(pager, filename_with_zext, man, level))
                return 1;
 #endif
 #if ENABLE_FEATURE_SEAMLESS_BZ2
        strcpy(ext, "bz2");
-       if (run_pipe(pager, man_filename, man, level))
+       if (run_pipe(pager, filename_with_zext, man, level))
                return 1;
 #endif
 #if ENABLE_FEATURE_SEAMLESS_GZ
        strcpy(ext, "gz");
-       if (run_pipe(pager, man_filename, man, level))
+       if (run_pipe(pager, filename_with_zext, man, level))
                return 1;
 #endif
 
-#if SEAMLESS_COMPRESSION
-       ext[-1] = '\0';
-#endif
-       if (run_pipe(pager, man_filename, man, level))
-               return 1;
-
-       return 0;
+       return run_pipe(pager, man_filename, man, level);
 }
 
 int man_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;