aboutsummaryrefslogtreecommitdiff
path: root/gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzip.c')
-rw-r--r--gzip.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/gzip.c b/gzip.c
index 76df3ad9a..3438ee42f 100644
--- a/gzip.c
+++ b/gzip.c
@@ -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
280local 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: */
283extern int zip OF((int in, int out)); 284extern int zip OF((int in, int out));
@@ -328,7 +329,6 @@ extern void warn OF((char *a, char *b));
328extern void read_error OF((void)); 329extern void read_error OF((void));
329extern void write_error OF((void)); 330extern void write_error OF((void));
330extern void display_ratio OF((long num, long den, FILE *file)); 331extern void display_ratio OF((long num, long den, FILE *file));
331extern voidp xmalloc OF((unsigned int size));
332 332
333 /* in inflate.c */ 333 /* in inflate.c */
334extern int inflate OF((void)); 334extern 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 */
1918local 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