(mail_list): Use mail_command_list()
Showing
1 changed file
with
2 additions
and
27 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 Free Software Foundation, Inc. | 2 | Copyright (C) 1999, 2001, 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 |
... | @@ -26,31 +26,6 @@ | ... | @@ -26,31 +26,6 @@ |
26 | int | 26 | int |
27 | mail_list (int argc ARG_UNUSED, char **argv ARG_UNUSED) | 27 | mail_list (int argc ARG_UNUSED, char **argv ARG_UNUSED) |
28 | { | 28 | { |
29 | const char *cmd = NULL; | 29 | mail_command_list (); |
30 | int i = 0, pos = 0, len = 0; | ||
31 | int cols = util_getcols (); | ||
32 | |||
33 | for (i=0; mail_command_table[i].shortname != 0; i++) | ||
34 | { | ||
35 | len = strlen (mail_command_table[i].longname); | ||
36 | if (len < 1) | ||
37 | { | ||
38 | cmd = mail_command_table[i].shortname; | ||
39 | len = strlen (cmd); | ||
40 | } | ||
41 | else | ||
42 | cmd = mail_command_table[i].longname; | ||
43 | |||
44 | pos += len + 1; | ||
45 | |||
46 | if (pos >= cols) | ||
47 | { | ||
48 | pos = len + 1; | ||
49 | fprintf (ofile, "\n%s ", cmd); | ||
50 | } | ||
51 | else | ||
52 | fprintf (ofile, "%s ", cmd); | ||
53 | } | ||
54 | fprintf (ofile, "\n"); | ||
55 | return 0; | 30 | return 0; |
56 | } | 31 | } | ... | ... |
-
Please register or sign in to post a comment