* checks/stackovf.test (tmpfile): Use 300K rather than 50K, since
at least OpenBSD's sh died early from an undersized stack limit.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/Makefile.am (m4_LDADD): Use libsigsegv when available and
necessary, via LIBCSTACK.
* src/m4.c (main) [DEBUG_STACKOVF]: Make it easier to test fault
handlers.
* checks/stackovf.test: New file.
* checks/Makefile.in (CHECKS): Add stackovf.test, and factor...
(DOC_CHECKS): ...generated documentation tests into new macro.
(DISTFILES): Distribute stackovf.test.
* checks/check-them: Special-case stackovf.test.
* NEWS: Enhance the NEWS item for -L improvements.
* README: Mention the optional dependency.
* HACKING: Mention maintenance burden added by libsigsegv.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/input.c (pop_input): Fix -di output on end of input.
* doc/m4.texinfo (Debug Levels): Test this behavior.
(Changeword, Location): Correct examples.
* checks/check-them (examples): Update to account for recommended
location for running tests.
* doc/m4.texinfo (Debug Levels): Test this behavior.
Signed-off-by: Eric Blake <ebb9@byu.net>
* checks/Makefile.in (program_transform_name): New macro.
(installcheck): Use it to transform name of m4 before testing.
* checks/check-them (m4): Add -m option, to allow testing m4 by a
different name.
Signed-off-by: Eric Blake <ebb9@byu.net>
* m4/gnulib-cache.m4: Import quote and memmem modules.
* src/m4.h (arg_scratch): New prototype.
* src/input.c (INPUT_INLINE_THRESHOLD): New define.
(push_token): Use it to inline short text, and save references to
longer text.
(input_init, next_token): Simplify obstack handling.
* src/macro.c (expand_argument): Likewise.
(expand_macro): Track scratch space.
(arg_scratch): New function.
(make_argv_ref): Use it.
(push_args): Likewise, and simplify comma handling, since most
separators are short enough to be inlined.
* src/builtin.c (builtin_init): Avoid cast.
(m4_errprint, m4_index): Transparently support NUL.
(m4_translit): Use scratch space, rather than leaking memory on
expansion stack.
* doc/m4.texinfo (Syntax): Add new test of embedded NUL.
* checks/get-them: Extract test that uses external files.
* checks/check-them: Run the new test. Use unified diff if
possible, and force text mode when debugging NUL handling.
* examples/null.m4: New file.
* examples/null.out: Likewise.
* examples/null.err: Likewise.
* examples/Makefile.am (EXTRA_FILES): Distribute these files.
* .gitattributes: Treat new files as text, in spite of embedded
NUL.
(cherry picked from commit a6c94a314afa34958330b719d66c2d4e403a94af)
Signed-off-by: Eric Blake <ebb9@byu.net>
* bootstrap (LC_ALL): Set up front.
(version control) Borrow idea from head, to avoid churn in
m4/.*ignore files modified by gnulib-tool.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/m4.texinfo (Preprocessor features): Add a test.
* checks/get-them: Support extra options in testsuite.
* checks/check-them (examples): Use extra options.
* THANKS: Update.
Reported by Sergey Poznyakoff.
TeX, so recognize '@w{ }' instead. Likewise, @code{_name} at the
end of a TeX line splits incorrectly.
(Foreach, Improved foreach): Write these sections, borrowing ideas
from CVS head and from m4sugar.
* checks/get-them: Accomodate new way to show trailing space in
examples.
* examples/foreach.m4: Make usable in documentation.
* examples/foreachq.m4: New file.
* examples/foreachq2.m4: New file.
* examples/foreach2.m4: New file.
* NEWS: Document the documentation updates.
native echo is braindead.
* checks/check-them (strip_needed): Ignore r in output. Now the
testsuite will pass when cross-compiling from cygwin to mingw.
* doc/m4.texinfo (Defn, Builtin, Debug Levels, Debug Output): Add
more examples.
(Dnl): Update example to show side effects.
* checks/get-them: Generate three digit test names.
* checks/Makefile.in (CHECKS): Accomodate 100+ tests.
* checks/check-them: Filter non-input lines, so line counts are
more realistic in the documentation, and so changeword tests work
even when dnl is disabled.
* doc/m4.texinfo: Adjust example line numbers. Clean up
front-matter, following autoconf's example.
(Changeword): Enable tests, skipping if changeword not supported.
(Define, Defn, Ifelse): Backport more examples from head.
(Input processing, Answers): New nodes, backported from head.
(Include): Expand test to cover empty filename.
(Undivert): Add test of undivert(0).
* src/Makefile.am (AM_CPPFLAGS): Omit space between -I and
directory, as required by Solaris cc. Include built headers, as
required by Solaris make in VPATH build.
* checks/Makefile.in: Use $(srcdir) where needed.
(CHECKS): Factor $(srcdir) into macro.
(DISTFILES): Likewise. Automake takes care of distributing
Makefile.in.
(dist): Simplify.
(Makefile): Use modern syntax of config.status.
* doc/m4.texinfo (Loops, Include, Undivert, Incompatibilities):
Avoid overfull and underfull hboxes in dvi.
now live in a single directory. Use forloop.m4 in testsuite.
* checks/incl.m4, checks/foo, checks/wrapfifo.m4: Move from
here...
* examples/incl.m4, examples/foo, examples/wrapfifo.m4: ...to
here.
* checks/Makefile.in (DISTFILES): Don't distribute moved files.
* examples/Makefile.am (EXTRA_DIST): Distribute new files.
* checks/check-them: Avoid s/// when filename is in pattern.
* examples/forloop.m4: Fix to match documentation.
* doc/m4.texinfo (Include, Undivert, Incompatibilities): Reflect
new locations.
(Loops, Format): Actually use forloop.m4 in tests.
$(bindir) works in installcheck.
(check, installcheck): No longer change directory, so that
distcheck works with a read-only builddir.
* checks/check-them: Work when pwd is no longer builddir.
signal<<8 rather than 0 if syscmd is terminated by a signal.
* configure.ac (AC_CHECK_HEADERS_ONCE): Check for sys/wait.h.
* src/builtin.c (include): Include sys/wait.h when stdlib.h does
not provide wait macros.
(WTERMSIG, WIFSIGNALED, WIFEXITED): More fallback macros.
(M4SYSVAL_EXITBITS, M4SYSVAL_TERMSIGBITS): New helper macros.
(m4_esyscmd): Set sysval to -1 on failure.
(m4_sysval): Print 127 on failure, and accomodate signals if they
are detectable.
* NEWS: Document this change.
* doc/m4.texinfo (Platform macros, Esyscmd, Sysval): Fix typos in
last commit.
* checks/check-them: Likewise.
* src/debug.c (debug_set_file): Work around mingw fstat bug.
* src/freeze.c (produce_frozen_state): Use new spelling of
platform macro.
* src/builtin.c (predefined_tab): Add __windows__ on non-unix
platforms.
(m4_syscmd, m4_esyscmd): The empty command is successful.
* doc/m4.texinfo (Shell commands): Rename from UNIX commands.
Document platform-dependence of system().
(Syscmd): Add example.
(Esyscmd): Make example more robust, and actually demonstrate
rescanning.
(Sysval): Expand test to cover esyscmd code path, and to check
that empty command is successful. Add conditional check for
signal behavior.
(Other Incompatibilities): Move platform macros from here...
(Platform macros): ...to this new node. Add windows macro.
Check that exactly one platform macro is provided.
* checks/check-them: Improve trap cleanup. Tolerate dirname and
.exe in error messages. Allow for skipping checks.
* configure.ac (HAVE_EFGCVT): Kill dead configure check.
* NEWS: Document platform mac
(tabchar): New macro, so that 'make check' still works.
(Invoking m4): Document that ignored compatibility options -B, -S,
and -T each consume an argument.
* checks/get-them: Honor @tabchar{}.
in read-only dir.
Use automake.
* Makefile.am: New file.
* doc/Makefile.am: Ditto.
* examples/Makefile.am: Ditto.
* lib/Makefile.am: Ditto.
* src/Makefile.am: Ditto.
* acinclude.m4: New file, renamed from aclocal.m4.
* configure.ac (AM_INIT_AUTOMAKE): Invoke new macro.
(AC_ARG_PROGRAM): Now redundant.
(STACKOVF): Turn into automake conditional.
(AC_CONFIG_COMMANDS): stamp-h is a command, not a file.
* checks/Makefile.in: Converting this dir to automake was not
trivial; for now, just add missing targets demanded by top-level.
* INSTALL: Remove files that are now generated from CVS.
* Makefile.in: Ditto.
* aclocal.m4: Ditto.
* install-sh: Ditto.
* mkinstalldirs: Ditto.
* doc/Makefile.in: Ditto.
* doc/texinfo.tex: Ditto.
* examples/Makefile.in: Ditto.
* lib/Makefile.in: Ditto.
* src/Makefile.in: Ditto.
* doc/m4.texinfo: Use m4.input instead of filename.
* checks/check-them (xerr): Turn m4.input into filename.
* checks/Makefile.in (dist): Depend on stamp-checks.
checks/47.patsubst, with a redundant @comment to prevent emacs
from removing it accidentally again.
* checks/get-them: Allow for trailing spaces tucked behind
@comment marks.
* configure.in (VERSION): Bump to 1.4.1.
* NEWS: Describe 1.4.1's changes.
* aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
pacify Autoconf 2.59.
* doc/m4.texinfo: Insert commas after @xref's that lack them,
to pacify Texinfo 4.7.
* doc/Makefile.in (info): Remove info-1, info-2, info-3.
* src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
pacify Sun C compilers.
* src/symtab.c (lookup_symbol): Fix an uninitialized-variable
botch.
* examples/stackovf.sh: Use tempfile if available.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
* src/output.c (m4_insert_file): Do not mix buffered and
unbuffered I/O, as this breaks on the Hurd. (trivial change)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
* src/m4.c (main): Fix format vulnerabilities. (trivial change)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
* doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
empty file rather than to a nonexistent file. This closes a common
security hole.
* src/builtin.c (m4_maketemp): Implement the above, by using
mkstemp rather than mktemp. (trivial change)
* src/builtin.c (expand_ranges): Added break after trailing dash.
This caused misbehaviors on some systems.