- builds use OpenSSL if available.
- post now defaults to port 587 on 'smtp' message submission.
+- A value of 0 for the width switch of scan(1), inc(1), ap(1), dp(1),
+ fmttest(1), and mhl(1) now means as many characters as the format
+ engine can produce [Bug #15274]. That amount is limited by internal
+ buffers.
-----------------
OBSOLETE FEATURES
-.TH FMTTEST %manext1% "August 24, 2014" "%nmhversion%"
+.TH FMTTEST %manext1% "August 31, 2014" "%nmhversion%"
.\"
.\" %nmhwarning%
.\"
part of a multibyte character are not counted against this total.
Two special values are supported:
.RI \*(lq max \*(rq,
-which will set the value to the maximum value of an integer, and
+which means as many characters as the format engine can produce
+(limited by internal buffers), and
.RI \*(lq width \*(rq,
which will set the
-value to the width of the terminal. In message mode it defaults to the
-terminal width, otherwise the default is the maximum value of an integer.
+value to the width of the terminal. In message mode it defaults to
+.RI \*(lq width \*(rq,
+otherwise the default is
+.RI \*(lq max \*(rq.
.PP
The
.B \-width
#define NADDRS 100
#define WIDTH 78
-#define WBUFSIZ BUFSIZ
#define FORMAT "%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>"
main (int argc, char **argv)
{
int addrp = 0;
- int width = 0, status = 0;
+ int width = -1, status = 0;
char *cp, *form = NULL, *format = NULL, *nfs;
char buf[BUFSIZ], **argp;
char **arguments, *addrs[NADDRS];
/* get new format string */
nfs = new_fs (form, format, FORMAT);
- if (width == 0) {
- if ((width = sc_width ()) < WIDTH / 2)
+ if (width == -1) {
+ if ((width = sc_width ()) < WIDTH / 2) {
+ /* Default: width of the terminal, but at least WIDTH/2. */
width = WIDTH / 2;
+ } else if (width == 0) {
+ /* Unlimited width. */
+ width = INT_MAX;
+ }
width -= 2;
}
- if (width > WBUFSIZ)
- width = WBUFSIZ;
fmt_compile (nfs, &fmt, 1);
dat[0] = 0;
#define NDATES 100
#define WIDTH 78
-#define WBUFSIZ BUFSIZ
#define FORMAT "%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>"
int
main (int argc, char **argv)
{
- int datep = 0, width = 0, status = 0;
+ int datep = 0, width = -1, status = 0;
char *cp, *form = NULL, *format = NULL, *nfs;
char buf[BUFSIZ], **argp, **arguments;
char *dates[NDATES];
/* get new format string */
nfs = new_fs (form, format, FORMAT);
- if (width == 0) {
- if ((width = sc_width ()) < WIDTH / 2)
+ if (width == -1) {
+ if ((width = sc_width ()) < WIDTH / 2) {
+ /* Default: width of the terminal, but at least WIDTH/2. */
width = WIDTH / 2;
+ } else if (width == 0) {
+ /* Unlimited width. */
+ width = INT_MAX;
+ }
width -= 2;
}
- if (width > WBUFSIZ)
- width = WBUFSIZ;
fmt_compile (nfs, &fmt, 1);
dat[0] = 0;
main (int argc, char **argv)
{
int chgflag = 1, trnflag = 1;
- int noisy = 1, width = 0;
+ int noisy = 1, width = -1;
int hghnum = 0, msgnum = 0;
int sasl = 0;
int incerr = 0; /* <0 if inc hits an error which means it should not truncate mailspool */
static int bell = 1;
static int newline = 1;
static int biff = 0;
-static int width = 0;
+static int width = -1;
static char *form = NULL;
static char *format = NULL;
main (int argc, char **argv)
{
int clearflag = 0, hdrflag = 0, ontty;
- int width = 0, revflag = 0;
+ int width = -1, revflag = 0;
int i, state, msgnum;
ivector_t seqnum = ivector_create (0);
int unseen, num_unseen_seq = 0;
#include <h/tws.h>
#include <h/utils.h>
-#define MAXSCANL 256 /* longest possible scan line */
-
/*
* Buffer size for content part of header fields. We want this
* to be large enough so that we don't do a lot of extra FLDPLUS
way the code is now, with callers initializing *scanl to NULL.
scanl used to be a global. */
if (! *scanl) {
- if (width == 0) {
+ if (width == -1) {
+ /* Default: width of the terminal, but at least WIDTH/2. */
if ((width = sc_width ()) < WIDTH/2)
width = WIDTH/2;
- else if (width > MAXSCANL)
- width = MAXSCANL;
+ } else if (width == 0) {
+ /* Unlimited width. */
+ width = INT_MAX;
}
dat[3] = slwidth = width;
*scanl = charstring_create (width);