/[mailutils]/mailutils/mail/if.c
ViewVC logotype

Diff of /mailutils/mail/if.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by gray, Wed Aug 7 15:29:24 2002 UTC revision 1.8 by polak, Mon Dec 23 22:01:34 2002 UTC
# Line 1  Line 1 
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"
# Line 52  _cond_push(int val) Line 52  _cond_push(int val)
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;
# Line 63  _cond_pop() Line 63  _cond_pop()
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];
# Line 85  mail_if (int argc, char **argv) Line 85  mail_if (int argc, char **argv)
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    
# Line 115  mail_if (int argc, char **argv) Line 115  mail_if (int argc, char **argv)
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      }      }
# Line 131  mail_else (int argc, char **argv) Line 131  mail_else (int argc, char **argv)
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();
# Line 147  mail_endif (int argc, char **argv) Line 147  mail_endif (int argc, char **argv)
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    
   

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26