1 |
/* GNU mailutils - a suite of utilities for electronic mail |
/* GNU Mailutils -- a suite of utilities for electronic mail |
2 |
Copyright (C) 1999, 2001 Free Software Foundation, Inc. |
Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
GNU Mailutils is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
6 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
7 |
any later version. |
any later version. |
8 |
|
|
9 |
This program is distributed in the hope that it will be useful, |
GNU Mailutils is distributed in the hope that it will be useful, |
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
GNU General Public License for more details. |
GNU General Public License for more details. |
13 |
|
|
14 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
15 |
along with this program; if not, write to the Free Software |
along with GNU Mailutils; if not, write to the Free Software |
16 |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
17 |
|
|
18 |
#include "mail.h" |
#include "mail.h" |
52 |
|
|
53 |
if (!_cond_stack) |
if (!_cond_stack) |
54 |
{ |
{ |
55 |
util_error("not enough memory"); |
util_error(_("not enough memory")); |
56 |
exit (EXIT_FAILURE); |
exit (EXIT_FAILURE); |
57 |
} |
} |
58 |
_cond_stack[_cond_level++] = val; |
_cond_stack[_cond_level++] = val; |
63 |
{ |
{ |
64 |
if (_cond_level == 0) |
if (_cond_level == 0) |
65 |
{ |
{ |
66 |
util_error("internal error: condition stack underflow"); |
util_error(_("internal error: condition stack underflow")); |
67 |
abort(); |
abort(); |
68 |
} |
} |
69 |
return _cond_stack[--_cond_level]; |
return _cond_stack[--_cond_level]; |
85 |
|
|
86 |
if (argc != 2) |
if (argc != 2) |
87 |
{ |
{ |
88 |
util_error("if requires an argument: s | r | t"); |
util_error(_("if requires an argument: s | r | t")); |
89 |
return 1; |
return 1; |
90 |
} |
} |
91 |
|
|
92 |
if (argv[1][1] != 0) |
if (argv[1][1] != 0) |
93 |
{ |
{ |
94 |
util_error("valid if arguments are: s | r | t"); |
util_error(_("valid if arguments are: s | r | t")); |
95 |
return 1; |
return 1; |
96 |
} |
} |
97 |
|
|
115 |
cond = interactive; |
cond = interactive; |
116 |
break; |
break; |
117 |
default: |
default: |
118 |
util_error("valid if arguments are: s | r | t"); |
util_error(_("valid if arguments are: s | r | t")); |
119 |
return 1; |
return 1; |
120 |
} |
} |
121 |
} |
} |
131 |
(void)argc; (void)argv; |
(void)argc; (void)argv; |
132 |
if (_cond_level == 0) |
if (_cond_level == 0) |
133 |
{ |
{ |
134 |
util_error("else without matching if"); |
util_error(_("else without matching if")); |
135 |
return 1; |
return 1; |
136 |
} |
} |
137 |
cond = _cond_pop(); |
cond = _cond_pop(); |
147 |
(void)argc; (void)argv; |
(void)argc; (void)argv; |
148 |
if (_cond_level == 0) |
if (_cond_level == 0) |
149 |
{ |
{ |
150 |
util_error("endif without matching if"); |
util_error(_("endif without matching if")); |
151 |
return 1; |
return 1; |
152 |
} |
} |
153 |
_cond_pop(); |
_cond_pop(); |
154 |
return 1; |
return 1; |
155 |
} |
} |
156 |
|
|
|
|
|