argv_ref patch 28: handle NUL in warning messages

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm still going rather slowly at porting the argv_ref branch into master.
 This patch rounds out the handling of embedded NUL in all of the builtins
(in most of these cases, the presence of an embedded NUL is a user bug,
but the warning message should not be truncated at the NUL).  I still need
to beef up the NEWS and manual about the fact that embedded NUL support is
now present in m4.  On the master branch, I subdivided the patch into
three roughly equal parts.  Also, working on this patch uncovered a hole
in branch-1.6 handling of warning on popdef(undef), which I patched
earlier today.  No real change in memory usage or speed.

	Stage 28: Allow embedded NUL in warning messages.
	Issue graceful error messages for a variety of places where
	embedded NUL is otherwise unhandled.  For example, numeric parsing
	rejects embedded NUL, while file-related commands warn about
	truncation at NUL, and frozen files detect unexpected NUL.
	Memory impact: none.
	Speed impact: none noticed.
	* src/m4.h (debug_decode): Add argument.
	* src/m4.c (main): Adjust caller.
	* src/format.c (arg_int, arg_long, arg_double): Likewise.
	(arg_string): New function.
	(ARG_INT, ARG_LONG, ARG_STR, ARG_DOUBLE): Support embedded NUL.
	* src/freeze.c (reload_frozen_state): Likewise.
	* src/debug.c (debug_decode): Likewise.
	* src/builtin.c (numeric_arg): Add argument.
	(m4_syscmd, m4_esyscmd, m4_eval, m4_incr, m4_decr, m4_divert)
	(m4_undivert, include, mkstemp_helper, m4_m4exit, m4_debugmode)
	(m4_debugfile, m4_index, m4_substr): Detect embedded NUL.
	(m4_defn, m4_maketemp, m4_placeholder): Improve warning message.
	* src/path.c (m4_path_search): Likewise.
	* doc/m4.texinfo (Syntax, Mkstemp, Using frozen files): Adjust
	tests.
	* examples/null.m4: Likewise.
	* examples/null.out: Likewise.
	* examples/null.err: Likewise.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmTlywACgkQ84KuGfSFAYBadwCgnNHWJdUxeGRE+uGPZxa9VGTk
GngAoK0Zk3cA5jlccjK3ixr4HPpuX9/i
=J55f
-----END PGP SIGNATURE-----

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch396 (text/plain, 104.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.