summaryrefslogtreecommitdiff
path: root/lib/regex.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-02-28 13:54:33 +0000
committerJim Meyering <jim@meyering.net>1995-02-28 13:54:33 +0000
commit6e811f30ac5cb7cdf9c60b8bc2ae5ea28646f975 (patch)
treedc101149ffd33b91ced02c8552ecd2793cc29393 /lib/regex.c
parent40f6e920679bdadd5f391d8043347489d89993d1 (diff)
downloadcoreutils-6e811f30ac5cb7cdf9c60b8bc2ae5ea28646f975.tar.xz
(SET_REGS_MATCHED): Enclose if-stmt in `do {...} while(0)'
instead of using trailing `else' -- otherwise, gcc -Wall complains of `empty body in an else-statement'.
Diffstat (limited to 'lib/regex.c')
-rw-r--r--lib/regex.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/regex.c b/lib/regex.c
index abab97412..04e92a8bd 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -1241,20 +1241,22 @@ typedef union
/* Call this when have matched a real character; it sets `matched' flags
for the subexpressions which we are currently inside. Also records
that those subexprs have matched. */
-#define SET_REGS_MATCHED() \
- if (!set_regs_matched_done) \
- { \
- unsigned r; \
- set_regs_matched_done = 1; \
- for (r = lowest_active_reg; r <= highest_active_reg; r++) \
- { \
- MATCHED_SOMETHING (reg_info[r]) \
- = EVER_MATCHED_SOMETHING (reg_info[r]) \
- = 1; \
- } \
- } \
- else
-
+#define SET_REGS_MATCHED() \
+ do \
+ { \
+ if (!set_regs_matched_done) \
+ { \
+ unsigned r; \
+ set_regs_matched_done = 1; \
+ for (r = lowest_active_reg; r <= highest_active_reg; r++) \
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+ = EVER_MATCHED_SOMETHING (reg_info[r]) \
+ = 1; \
+ } \
+ } \
+ } \
+ while (0)
/* Registers are set to a sentinel when they haven't yet matched. */
static char reg_unset_dummy;