From 84f7231dfa0bceb8dba912c9b34a5f93109b9458 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?=
Date: Mon, 23 Oct 2017 23:26:33 -0700 Subject: [PATCH] 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. --- src/stty.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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++) { -- 2.47.2