Commit Graph

148 Commits

Author SHA1 Message Date
uwe
e41114cd45 eval: Make radix optional even if minimum result width is specified.
This is what GNU m4 does too.
2020-06-27 19:18:58 +00:00
uwe
97fe11755b Improve markup for better PostScript output.
Make sure quotes are right and copy-pastable even in UTF-8 output.
2020-06-27 19:07:15 +00:00
uwe
977c3c75e7 Use a date that is actually a real date. 2020-06-25 02:59:20 +00:00
uwe
c5ff99308b Bump date for previous. 2020-06-25 02:58:16 +00:00
uwe
24af426db6 Fix --error-output to be more like GNU m4. It's a long version of -o. 2020-06-25 02:54:50 +00:00
uwe
7c332fd36c Fix --error-output to be more like GNU m4.
GNU m4 --error-output is the same as -o despite the name.  It does NOT
affect warnings, error messages, and 'errprint' output so drop the
misguided bit of code that tried to freopen stderr without closing it
on failure.  Drop -e (which was our local invention) and make merge
--error-output with -o so that both set traceout.  Make trace_file()
preserve the old traceout on error and return error status so that the
caller can emit appropriate warning.

Do not yet support disabling tracing with an empty name, the rest of
the code is not ready, we don't do -o positionally and we don't have
`debugfile'.
2020-06-25 02:25:53 +00:00
uwe
00da1c7eff Try not to lose error output with --error-output.
Try to avoid the trap we set up ourselves while avoiding freopen(3).
When exit flushes and closes open streams it may close sfp first and
when it comes about to flush and close stderr, the descriptor is
already gone and we lose any buffered error output.  This actually
happens on some hosts, breaking --trace output used by autoconf.
2020-06-24 16:49:30 +00:00
kre
67d9f38e0b Use correct printf format for (struct input_file *)->lineno
SHould unbreak 32 bit host builds.
2019-03-26 23:31:45 +00:00
christos
26bb5ab43c fix use-after-free issue. 2019-03-26 16:41:06 +00:00
christos
5eea377e88 print the source line and file where the error happened. 2019-03-26 16:39:50 +00:00
christos
82af0135c7 Behave like gnu m4; when the error output file cannot be opened, just warn
and keep going.
2019-03-26 15:00:34 +00:00
kre
9f2b1d9e76 Avoid an infinite loop caused by a line accidentally dropped
in 1.22 (almost 30 months ago!)

[ Discovered by rhialto@ ]
2018-07-30 22:58:09 +00:00
christos
5716b2d864 remove the braces I accidentally added. 2017-10-23 02:38:46 +00:00
christos
ffb871e671 PR/52638: matthew green: missing argument check causes m4 to core in ifelse() 2017-10-22 23:01:34 +00:00
christos
a687207309 Explain what REDIRECT is for. 2016-01-23 14:24:43 +00:00
wiz
cbba3dff68 Fix some macros. Sort stuff some more. 2016-01-17 11:24:28 +00:00
christos
6fee39189c Update documentation. 2016-01-16 21:15:51 +00:00
christos
24926742d3 fix the option string. 2016-01-16 21:12:27 +00:00
christos
ac2c28bce6 mention that nesting limit is unimplemented 2016-01-16 18:33:35 +00:00
christos
9c5ae85a12 add most gnu m4 long options 2016-01-16 18:31:29 +00:00
christos
42d917fdb8 add nesting_limit 2016-01-16 18:30:57 +00:00
christos
1e0a1203e1 record all input for fake freeze 2016-01-16 17:01:22 +00:00
christos
8178859046 Use hex for masks. 2016-01-16 17:01:01 +00:00
christos
59e8ea8f4c Add disabled support for saving and restoring the symbol table. 2016-01-16 17:00:07 +00:00
christos
8a4a35b9bc - don't eat the rest of the string when no match in patsubst
- include the pattern in the error printing of regex
- handle 3 argument and empty patterns the gnu way
- add support for freezing and thawing state (not working yet)
2016-01-16 16:59:18 +00:00
christos
bf45a83338 - declarations for real/fake freeze
- add new flags
2016-01-16 16:57:29 +00:00
christos
50b61022b2 More gnu compatibility:
- handle macros > $9
	- handle character remapping the the gnu way.
Add a shortcut for the "fake freeze" files to not expand include macros
during thawing.
2016-01-16 16:56:21 +00:00
christos
42e28dd7ad use strtoi instead of strtonum, since this is a tool. 2015-01-29 19:26:20 +00:00
christos
b3decb4766 latent strtonum removal. 2015-01-29 13:20:51 +00:00
christos
fff8579aad delete extern 2015-01-29 03:27:06 +00:00
joerg
1382c4d712 Don't depend on yacc skeleton to include sys/cdefs.h early. 2015-01-04 18:31:09 +00:00
dholland
c3ab26950f Rework /usr/share/doc.
Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
   - explicit use of soelim
   - refer
   - tbl
   - pic
   - eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.
2014-07-05 19:22:02 +00:00
wiz
0eb3a654b0 Better document eval, mentioning optional second and third arguments.
Requested by martin.
Bump date.
2014-01-07 13:32:21 +00:00
christos
9f630f8bc1 avoid redefinitions 2013-10-18 20:19:36 +00:00
wiz
a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos
3d8af4cc0a Fix wrong loop index leading to infinite loop
ifdef(`FOO',
# FOO
)
XXX: Pullup to 6.
2012-04-25 18:23:58 +00:00
wiz
1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
matt
d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
joerg
66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
joerg
f0f23e661a Move usage and onintr to make them static. Add __dead as needed. 2011-09-06 18:16:01 +00:00
dholland
879c64122d Requires stdint.h. 2011-08-21 23:38:43 +00:00
christos
42ff0d2ac9 kill gcc-4.5 warning 2011-08-14 12:59:25 +00:00
mrg
5ed322d90a apply some -Wno-error/-Wno-enum-compare/-Wno-array-bounds.
this should be looked at more closely.
2011-06-22 05:23:53 +00:00
joerg
de7d5b1342 Doesn't need input. 2011-05-24 12:32:36 +00:00
riz
802dd4220f Revert previous, to fix build on Mac OS X again.
ok christos@
2011-03-08 23:55:19 +00:00
christos
a469df4a1b add other os support from MirBSD 2011-03-05 16:38:46 +00:00
christos
5a8a9e34c6 add mimic_gnu for eval print. 2011-03-05 16:38:25 +00:00
christos
0b915be387 use TOKEN_LINE from MirBSD 2011-03-05 16:37:50 +00:00
joerg
25206905a3 Improve/fix/deuglify markup. 2010-05-14 17:14:28 +00:00
joerg
98712b66ed Fix __progname mess. 2009-11-06 15:13:27 +00:00