(mail_if): Fix 'r' condition
(mail_else): Fix handling of nested ifs
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -111,7 +111,7 @@ mail_if (int argc, char **argv) | ... | @@ -111,7 +111,7 @@ mail_if (int argc, char **argv) |
111 | cond = strcmp(mode, "send") == 0; | 111 | cond = strcmp(mode, "send") == 0; |
112 | break; | 112 | break; |
113 | case 'r': /* Read mode */ | 113 | case 'r': /* Read mode */ |
114 | cond = strcmp(mode, "send") != 0; | 114 | cond = strcmp(mode, "read") == 0; |
115 | break; | 115 | break; |
116 | case 't': /* Stdout is a terminal device? */ | 116 | case 't': /* Stdout is a terminal device? */ |
117 | cond = isatty (fileno (stdout)); | 117 | cond = isatty (fileno (stdout)); |
... | @@ -138,7 +138,7 @@ mail_else (int argc ARG_UNUSED, char **argv ARG_UNUSED) | ... | @@ -138,7 +138,7 @@ mail_else (int argc ARG_UNUSED, char **argv ARG_UNUSED) |
138 | return 1; | 138 | return 1; |
139 | } | 139 | } |
140 | cond = _cond_pop(); | 140 | cond = _cond_pop(); |
141 | if (_cond_level == 0) | 141 | if (if_cond ()) |
142 | cond = !cond; | 142 | cond = !cond; |
143 | _cond_push(cond); | 143 | _cond_push(cond); |
144 | return 0; | 144 | return 0; | ... | ... |
-
Please register or sign in to post a comment