From: Sergey Poznyakoff Date: Thu, 11 Mar 2010 10:26:57 +0000 (+0200) Subject: Shut up a gcc warning message. X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=commitdiff_plain;h=3f4a6d83f09787a305e7cdaf6f08d6695cd9f9de Shut up a gcc warning message. * src/tar.c (tar_help_filter): Use a separate const variable to hold returns from gettext. Reported by Peter Breitenlohner. --- diff --git a/src/tar.c b/src/tar.c index da12419..e3fdf7b 100644 --- a/src/tar.c +++ b/src/tar.c @@ -1254,7 +1254,7 @@ tar_help_filter (int key, const char *text, void *input) { struct obstack stk; char *s; - + switch (key) { default: @@ -1286,19 +1286,23 @@ tar_help_filter (int key, const char *text, void *input) break; case ARGP_KEY_HELP_EXTRA: - obstack_init (&stk); - s = _("Valid arguments for the --quoting-style option are:"); - obstack_grow (&stk, s, strlen (s)); - obstack_grow (&stk, "\n\n", 2); - tar_list_quoting_styles (&stk, " "); - s = _("\n*This* tar defaults to:\n"); - obstack_grow (&stk, s, strlen (s)); - s = format_default_settings (); - obstack_grow (&stk, s, strlen (s)); - obstack_1grow (&stk, '\n'); - obstack_1grow (&stk, 0); - s = xstrdup (obstack_finish (&stk)); - obstack_free (&stk, NULL); + { + const char *tstr; + + obstack_init (&stk); + tstr = _("Valid arguments for the --quoting-style option are:"); + obstack_grow (&stk, tstr, strlen (tstr)); + obstack_grow (&stk, "\n\n", 2); + tar_list_quoting_styles (&stk, " "); + tstr = _("\n*This* tar defaults to:\n"); + obstack_grow (&stk, tstr, strlen (tstr)); + s = format_default_settings (); + obstack_grow (&stk, s, strlen (s)); + obstack_1grow (&stk, '\n'); + obstack_1grow (&stk, 0); + s = xstrdup (obstack_finish (&stk)); + obstack_free (&stk, NULL); + } } return s; }