* examples/stackovf.sh: Delete, now that checks has better
version.
* examples/Makefile.am (EXTRA_DIST): Don't distribute it.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/m4.h (struct call_info): New struct.
(trace_prepre, trace_pre, trace_post, push_string_finish)
(input_print, call_macro): Alter signatures.
(arg_info): New prototype.
(input_block): Delete...
* src/input.c (input_block): ...and make typedef local again.
(push_string_init): Initialize length.
(push_string_finish, input_print): Change signature, so that
printing can be done before finalization.
* src/macro.c (struct macro_arguments): Add info member.
(collect_arguments, make_argv_ref): Manage new field.
(expand_macro): Change call context management. Move tracing...
(call_macro): ...here, and remove redundant parameter.
(arg_info): New function.
* src/debug.c (trace_format): Delete unused modifiers.
(trace_header, trace_flush, trace_prepre, trace_pre, trace_post):
Change signatures for stacked trace messages, and for using call
context.
* src/builtin.c (m4_builtin, m4_indir): Update callers.
* src/m4.c (usage): Update debugmode flag summary.
* doc/m4.texinfo (Defn): Update examples to match new behavior.
(Trace): Mention new capability of indir.
(Debug Levels): Enhance text for 'c' and 'x', update examples.
(Incompatibilities): Mention risk of parsing trace output.
* examples/null.m4: Enhance test.
* examples/null.err: Update expected output.
* NEWS: Mention these changes.
Reported by Akim Demaille in the autoconf TODO file in 2000.
(cherry picked from commit ec804cba9ceeef7ca863d163eeae3fca669ccd16)
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/m4.h [__EMX__]: OS/2 does not have a Unix-compatible
system(3), no matter what other macros it pre-defined.
* doc/m4.texinfo (Mkstemp): Rework test to avoid globbing failure
on OS/2.
* src/builtin.c (predefined_tab): Ensure all possible system
identifiers are defined, not just the first; the testsuite will
catch if multiple identifiers mistakenly made it through.
* examples/null.m4 (esyscmd): Don't rely on printf to generate NUL
byte.
* examples/null.out (esyscmd): Check for esyscmd success.
* THANKS: Update.
Reported by Elbert Pol.
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>
* doc/m4.texinfo (Patsubst): Use the examples directory. Also
document shortfall.
(Improved capitalize): New node.
* examples/capitalize.m4: Update to match manual.
* examples/capitalize2.m4: New file.
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>
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.
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.
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.
* 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.