diff options
Diffstat (limited to 'gzip.c')
-rw-r--r-- | gzip.c | 27 |
1 files changed, 2 insertions, 25 deletions
@@ -277,7 +277,8 @@ extern int save_orig_name; /* set if original name must be saved */ | |||
277 | #define WARN(msg) {if (!quiet) fprintf msg ; \ | 277 | #define WARN(msg) {if (!quiet) fprintf msg ; \ |
278 | if (exit_code == OK) exit_code = WARNING;} | 278 | if (exit_code == OK) exit_code = WARNING;} |
279 | 279 | ||
280 | local void do_exit(int exitcode) __attribute__ ((noreturn)); | 280 | #define do_exit(c) exit(c) |
281 | |||
281 | 282 | ||
282 | /* in zip.c: */ | 283 | /* in zip.c: */ |
283 | extern int zip OF((int in, int out)); | 284 | extern int zip OF((int in, int out)); |
@@ -328,7 +329,6 @@ extern void warn OF((char *a, char *b)); | |||
328 | extern void read_error OF((void)); | 329 | extern void read_error OF((void)); |
329 | extern void write_error OF((void)); | 330 | extern void write_error OF((void)); |
330 | extern void display_ratio OF((long num, long den, FILE *file)); | 331 | extern void display_ratio OF((long num, long den, FILE *file)); |
331 | extern voidp xmalloc OF((unsigned int size)); | ||
332 | 332 | ||
333 | /* in inflate.c */ | 333 | /* in inflate.c */ |
334 | extern int inflate OF((void)); | 334 | extern int inflate OF((void)); |
@@ -1912,29 +1912,6 @@ int gzip_main(int argc, char ** argv) | |||
1912 | do_exit(exit_code); | 1912 | do_exit(exit_code); |
1913 | } | 1913 | } |
1914 | 1914 | ||
1915 | /* ======================================================================== | ||
1916 | * Free all dynamically allocated variables and exit with the given code. | ||
1917 | */ | ||
1918 | local void do_exit(int exitcode) | ||
1919 | { | ||
1920 | static int in_exit = 0; | ||
1921 | |||
1922 | if (in_exit) exit(exitcode); | ||
1923 | in_exit = 1; | ||
1924 | if (env != NULL) free(env), env = NULL; | ||
1925 | if (args != NULL) free((char*)args), args = NULL; | ||
1926 | FREE(inbuf); | ||
1927 | FREE(outbuf); | ||
1928 | FREE(d_buf); | ||
1929 | FREE(window); | ||
1930 | #ifndef MAXSEG_64K | ||
1931 | FREE(tab_prefix); | ||
1932 | #else | ||
1933 | FREE(tab_prefix0); | ||
1934 | FREE(tab_prefix1); | ||
1935 | #endif | ||
1936 | exit(exitcode); | ||
1937 | } | ||
1938 | /* trees.c -- output deflated data using Huffman coding | 1915 | /* trees.c -- output deflated data using Huffman coding |
1939 | * Copyright (C) 1992-1993 Jean-loup Gailly | 1916 | * Copyright (C) 1992-1993 Jean-loup Gailly |
1940 | * This is free software; you can redistribute it and/or modify it under the | 1917 | * This is free software; you can redistribute it and/or modify it under the |