From: Pádraig Brady Date: Tue, 24 Oct 2017 06:26:33 +0000 (-0700) Subject: maint: apply suggested cleanup to recent stty.c change X-Git-Tag: v8.29~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84f7231dfa0bceb8dba912c9b34a5f93109b9458;p=thirdparty%2Fcoreutils.git maint: apply suggested cleanup to recent stty.c change This should have been part of commit v8.28-17-gf926f7c * src/stty.c (check_argument): Align line continuation chars, and ensure the function macro is immune to usage with if/else. Suggested by Jim Meyering and Paul Eggert. --- diff --git a/src/stty.c b/src/stty.c index 1a5c1e9620..df963462c1 100644 --- a/src/stty.c +++ b/src/stty.c @@ -1089,12 +1089,16 @@ apply_settings (bool checking, const char *device_name, struct termios *mode, bool *speed_was_set, bool *require_set_attr) { -#define check_argument(arg) \ - if (k == n_settings - 1 || ! settings[k+1]) \ - { \ - error (0, 0, _("missing argument to %s"), quote (arg)); \ - usage (EXIT_FAILURE); \ - } +#define check_argument(arg) \ + do \ + { \ + if (k == n_settings - 1 || ! settings[k+1]) \ + { \ + error (0, 0, _("missing argument to %s"), quote (arg)); \ + usage (EXIT_FAILURE); \ + } \ + } \ + while (0) for (int k = 1; k < n_settings; k++) {