Use mail_find_command() and mail_escape_help().
Showing
1 changed file
with
8 additions
and
8 deletions
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc. |
3 | 3 | ||
4 | GNU Mailutils is free software; you can redistribute it and/or modify | 4 | 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 | 5 | it under the terms of the GNU General Public License as published by |
... | @@ -187,27 +187,27 @@ var_shell (int argc, char **argv, compose_env_t *env) | ... | @@ -187,27 +187,27 @@ var_shell (int argc, char **argv, compose_env_t *env) |
187 | int | 187 | int |
188 | var_command (int argc, char **argv, compose_env_t *env) | 188 | var_command (int argc, char **argv, compose_env_t *env) |
189 | { | 189 | { |
190 | struct mail_command_entry entry; | 190 | struct mail_command_entry *entry; |
191 | int status; | 191 | int status; |
192 | 192 | ||
193 | if (var_check_args (argc, argv)) | 193 | if (var_check_args (argc, argv)) |
194 | return 1; | 194 | return 1; |
195 | if (argv[1][0] == '#') | 195 | if (argv[1][0] == '#') |
196 | return 0; | 196 | return 0; |
197 | entry = util_find_entry (mail_command_table, argv[1]); | 197 | entry = mail_find_command (argv[1]); |
198 | if (!entry.func) | 198 | if (!entry) |
199 | { | 199 | { |
200 | util_error (_("Unknown command: %s"), argv[1]); | 200 | util_error (_("Unknown command: %s"), argv[1]); |
201 | return 1; | 201 | return 1; |
202 | } | 202 | } |
203 | if (entry.flags & (EF_FLOW | EF_SEND)) | 203 | if (entry->flags & (EF_FLOW | EF_SEND)) |
204 | { | 204 | { |
205 | util_error (_("Command not allowed in an escape sequence\n")); | 205 | util_error (_("Command not allowed in an escape sequence\n")); |
206 | return 1; | 206 | return 1; |
207 | } | 207 | } |
208 | 208 | ||
209 | ofile = env->ofile; | 209 | ofile = env->ofile; |
210 | status = (*entry.func) (argc - 1, argv + 1); | 210 | status = (*entry->func) (argc - 1, argv + 1); |
211 | ofile = env->file; | 211 | ofile = env->file; |
212 | return status; | 212 | return status; |
213 | } | 213 | } |
... | @@ -217,13 +217,13 @@ int | ... | @@ -217,13 +217,13 @@ int |
217 | var_help (int argc, char **argv, compose_env_t *env ARG_UNUSED) | 217 | var_help (int argc, char **argv, compose_env_t *env ARG_UNUSED) |
218 | { | 218 | { |
219 | if (argc < 2) | 219 | if (argc < 2) |
220 | return util_help (mail_escape_table, NULL); | 220 | return mail_escape_help (NULL); |
221 | else | 221 | else |
222 | { | 222 | { |
223 | int status = 0; | 223 | int status = 0; |
224 | 224 | ||
225 | while (--argc) | 225 | while (--argc) |
226 | status |= util_help (mail_escape_table, *++argv); | 226 | status |= mail_escape_help (*++argv); |
227 | 227 | ||
228 | return status; | 228 | return status; |
229 | } | 229 | } | ... | ... |
-
Please register or sign in to post a comment