summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--1/24.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/1/24.c b/1/24.c
index 0e8e53f..7091896 100644
--- a/1/24.c
+++ b/1/24.c
@@ -16,16 +16,15 @@ int main(int argc, char *argv[]) {
parens = bracks = braces = 0;
for (i = 0; i < MAXLEN - 1 && (c = getchar()) != EOF; i++) {
- if (!comment && !quote && (c == '/' || c == '*') && p == '/') {
- comment = c == '/' ? INLINE : MULTILINE;
- } else if (!comment && !quote && c == '"') {
- quote = TRUE;
- } else if (comment == INLINE && c == '\n') {
+ if (!comment && !quote) {
+ if ((c == '/' || c == '*') && p == '/')
+ comment = c == '/' ? INLINE : MULTILINE;
+ else if (c == '"')
+ quote = TRUE;
+ } else if ((comment == INLINE && c == '\n') ||
+ (comment == MULTILINE && c == '/' && p == '*')) {
comment = FALSE;
- } else if (comment == MULTILINE && c == '/' && p == '*') {
- comment = FALSE;
- }
- if (!comment && quote && c == '"' && p != '\\') {
+ } else if (!comment && quote && c == '"' && p != '\\') {
quote = FALSE;
} else if (!comment && !quote) {
if (c == '{')