* doc/m4.texinfo (Using frozen files): Test the fix from
2007-11-22.
* THANKS: Update.
Reported by Jean-Charles Longuet.
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/builtin.m4 (traceon): Only perform insertion if lookup
fails.
* doc/m4.texinfo (Trace): Test for the bug.
* NEWS: Document it.
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>
* doc/m4.texinfo (Diversions): Consume all of m4's output, in case
SIGPIPE is ignored.
* THANKS: Update.
Detected by Bob Proulx's buildbot.
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>
* NEWS: Update to match release on branch-1.4.
* doc/m4.texinfo (History): Update release history.
(Format): Test for C99 hex-float parsing.
* src/Makefile.am (m4_LDADD): Use POW_LIB when needed.
Signed-off-by: Eric Blake <ebb9@byu.net>
* maint.mk (alpha): Check for PREV_VERSION setting sooner, and
remove tag operation.
(version-check): Enhance this check.
(prev-tarball): Depend on version-check.
(web-manual): Fix VPATH usage.
(this-vc-tag): Delete, and mention need to run tag...
* HACKING: ...here, prior to make maintainer-distcheck.
Update the instructions to match this particular release process.
* Makefile.am (.version, announcement): Allow for VPATH build.
* cfg.mk (gnulib_dir): Likewise.
* doc/Makefile.am ($(srcdir)/m4.1): Include release number in man
page.
Signed-off-by: Eric Blake <ebb9@byu.net>
(cherry picked from commit c07173b0a58b56c07633a28323d56451b98b7de5)
Conflicts:
* NEWS: Describe effect on autoconf 2.59 and earlier.
* doc/m4.texinfo (History): The next version will be 1.6, not
1.4.11.
Reported by Ralf Wildenhues.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/macro.c (make_argv_ref_token): Don't output expansion text
when making wrapper for builtin or indir.
* doc/m4.texinfo (Builtin): Test it.
* NEWS: Document the fix.
Reported by Andreas Schwab.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/macro.c (make_argv_ref_token): Avoid wrapping $@ when
possible.
(push_args): Let make_argv_ref_token take care of pending data.
* doc/m4.texinfo (Improved foreach): Tweak wording to match new
performance capability. Add regression tests.
* NEWS: Document the speedup.
* src/m4.c (AUTHORS): Claim credit for my rewrite.
(cherry picked from commit 58d580eeca1f75ddd2ca68d8b93fef6eead14350)
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/m4.texinfo (Incompatibilities): Use @. after capital.
(History): Use @: after abbreviations.
(M4exit): Use correct Latin abbreviation.
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/builtin.c (define_user_macro): Use correct length.
* doc/m4.texinfo (Arguments): Test the fix.
(History): Reword to account for new year and eventual result of
the argv_ref branch.
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>
* src/m4.h (obstack_regrow): Delete, now that it is unused.
(struct token_chain): Add level field.
(push_token): Adjust prototype.
(adjust_refcount): New prototype.
* src/macro.c [DEBUG_MACRO]: Add debugging hooks for $@ reference
counting.
(argc_stack, argv_stack): Delete, replaced by...
(struct macro_arg_stacks, stacks, stacks_count): ...these new
structure for tracking $@ references.
(expand_input): Initialize new structure.
(collect_arguments): Alter signature.
(expand_macro): Rework obstack handling, in order to keep $@
references alive until they have been rescanned.
(adjust_refcount, arg_mark): New functions.
(make_argv_ref): Use new field.
(push_arg, push_args): Update callers.
* src/input.c (make_text_link): Use new field.
(push_token): Change signature.
(pop_input, next_char_1): Call new function.
* doc/m4.texinfo: Clean up some examples of -d option usage.
(Ifelse): Add some stress tests.
(cherry picked from commit b0daa4c96f734aab4d450594f64bc15d4321fd60)
Signed-off-by: Eric Blake <ebb9@byu.net>
* src/builtin.c (mkstemp_helper): Produce quoted output.
* doc/m4.texinfo (Mkstemp): Update the documentation and tests.
* NEWS: Document this change.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/Makefile.am (HELP2MAN): New macro.
(man_MANS, m4.1): Fix rules for building m4.1 into srcdir.
* README: Update copyright.
* HACKING: Mention help2man and makeinfo dependencies.
Signed-off-by: Eric Blake <ebb9@byu.net>
* doc/m4.texinfo (Defn): Add tests.
* src/macro.c (warn_builtin_concat): New function.
(expand_argument): Use it to warn on more corner cases.
* NEWS: Mention new warning.
Signed-off-by: Eric Blake <ebb9@byu.net>
* configure.ac (PACKAGE, VERSION): Delete, since Automake does
this now.
(AC_CONFIG_AUX_DIR): Add, with auxiliary files in build-aux
instead of the top level.
* bootstrap: Adjust accordingly.
* m4/gnulib-cache.m4: Add --aux-dir option.
* doc/Makefile.am (m4.1): Rewrite rule to use build-aux/missing.
Signed-off-by: Eric Blake <ebb9@byu.net>