summaryrefslogtreecommitdiff
path: root/mh
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2003-11-04 13:16:16 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2003-11-04 13:16:16 +0000
commit356f6343b4d9790b537c9e538a96e26832684801 (patch)
treefdb4ede1419e9353a39c34605651ee899e1f44fb /mh
parent813738374a351f5d69e40a0867b068faeccbe707 (diff)
downloadmailutils-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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mh/ali.c b/mh/ali.c
index 79eda9bcd..263e62a8a 100644
--- a/mh/ali.c
+++ b/mh/ali.c
@@ -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]);
}
}
}

Return to:

Send suggestions and report system problems to the System administrator.