diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-11-04 13:16:16 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2003-11-04 13:16:16 +0000 |
commit | 356f6343b4d9790b537c9e538a96e26832684801 (patch) | |
tree | fdb4ede1419e9353a39c34605651ee899e1f44fb /mh | |
parent | 813738374a351f5d69e40a0867b068faeccbe707 (diff) | |
download | mailutils-356f6343b4d9790b537c9e538a96e26832684801.tar.gz mailutils-356f6343b4d9790b537c9e538a96e26832684801.tar.bz2 |
(getcols): Return default of 80 columns if both ioctl() and getenv() fail.
(ali_print_name_list): Bugfix.
(main): In -user mode, print the argument verbatim if it
is not a member of any alias.
Diffstat (limited to 'mh')
-rw-r--r-- | mh/ali.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -110,6 +110,8 @@ getcols () ws.ws_col = strtol (columns, NULL, 10); } + if (ws.ws_col == 0) + ws.ws_col = 80; return ws.ws_col; } @@ -137,7 +139,6 @@ ali_print_name_list (list_t list, int off) else { int ncol = getcols (); - int nl; int n = off; iterator_first (itr); @@ -146,14 +147,11 @@ ali_print_name_list (list_t list, int off) { int len; - nl = 0; iterator_current (itr, (void **)&item); len = strlen (item) + 2; if (n + len > ncol) - { - n = printf ("\n "); - nl = 1; - } + n = printf ("\n "); + len = printf ("%s", item); iterator_next (itr); if (!iterator_is_done (itr)) @@ -162,8 +160,7 @@ ali_print_name_list (list_t list, int off) break; n += len; } - if (!nl) - printf ("\n"); + printf ("\n"); } iterator_destroy (&itr); } @@ -246,6 +243,8 @@ main (int argc, char **argv) ali_print_name_list (nl, 0); list_destroy (&nl); } + else + printf ("%s\n", argv[i]); } } } |