summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog38
-rw-r--r--NEWS4
-rw-r--r--config.h.in2
-rwxr-xr-xconfigure2
-rw-r--r--configure.in4
-rw-r--r--doc/m4.info36
-rw-r--r--doc/stamp-vti2
-rw-r--r--doc/texinfo.tex2
-rw-r--r--doc/version.texi6
-rw-r--r--src/builtin.c4
-rw-r--r--src/m4.c6
-rw-r--r--src/output.c19
-rw-r--r--src/path.c7
-rw-r--r--stamp-h.in2
14 files changed, 86 insertions, 48 deletions
diff --git a/ChangeLog b/ChangeLog
index 3169c1dd..2433dab0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2004-08-19 Paul Eggert <eggert@twinsun.com>
+
+ * Release 1.4.2.
+
+ * configure.in (VERSION): Bump to 1.4.2.
+ * NEWS: Describe 1.4.2's changes.
+
+ * src/m4.c (reference_error): Preserve errno, since M4ERROR
+ relies on this.
+ * src/builtin.c (m4_esyscmd): Clear errno before calling popen.
+ (m4_maketemp): Clear errno before calling mkstemp.
+ * src/path.c (path_search): Don't let "free" trash errno when
+ returning NULL.
+ * src/output.c (insert_file): Don't assume errno has a valid
+ value simply because fread returns zero. This fixes a
+ portability bug reported by Marion Hakanson in
+ <http://lists.gnu.org/archive/html/bug-m4/2004-07/msg00029.html>.
+
2004-06-09 Gary V. Vaughan <gary@gnu.org>
* configure.in (VERSION): Bump to 1.4.1a.
@@ -347,7 +365,7 @@ Mon Aug 29 12:27:19 1994 Francois Pinard (pinard@icule)
Reported by David MacKenzie.
Freeze diversions:
- * output.c (freeze_diversions): New function.
+ * output.c (freeze_diversions): New function.
* m4.h: Declare freeze_diversions.
* freeze.c: Document frozen file format, revise it, call
freeze_diversions to add diversions to frozen format, and code to
@@ -471,7 +489,7 @@ Thu Jul 14 17:23:17 1994 Francois Pinard (pinard@icule)
* stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
error message, for when no code possibility exists. Even if this
- line is completely #ifdef'ed out, it brings a syntax error.
+ line is completely #ifdef'ed out, it brings a syntax error.
Reported by Andreas Schwab, Jim Meyering and Joseph E. Sacco.
* Makefile.in (install): Have install depend on all too, for lib
@@ -510,7 +528,7 @@ Wed Jul 6 13:16:31 1994 Jim Avera (jima@netcom.com)
* stackovf.c: Isolated OS-dependent sections; Improved portability,
adding support for SunOS/BSD (sigvec, sigstack, and 4-parameter signal
- handlers), and a default error message if the fault address is not
+ handlers), and a default error message if the fault address is not
available (when neither siginfo.h nor BSD sigcontext are supported).
* configure.in: Changes for stackovf.h: Check for sigcontext,
sigaction, sigstack, and define rlim_t as int if necessary.
@@ -566,11 +584,11 @@ Mon Jun 27 14:24:23 1994 Francois Pinard (pinard@icule)
(ntoa): Declare value as eval_t instead of int. Declare uvalue as
unsigned_eval_t instead of unsigned int. Change casts accordingly.
(shipout_int): Cast first argument of ntoa to eval_t.
- Reported by Thorsten Ohl.
+ Reported by Thorsten Ohl.
* macro.c: Complete the prototypes of forwarded expand_macro and
expand_token.
- Reported by Thorsten Ohl.
+ Reported by Thorsten Ohl.
* m4.h: Define voidstar as void * or char * depending on __STDC__.
The Ultrix 3.1 compiler cannot do much with void pointers.
@@ -607,7 +625,7 @@ Sat Jun 25 00:10:05 1994 Francois Pinard (pinard@icule)
* configure.in: Substitute CFLAGS and LDFLAGS, taking their value
from the environment. Default CFLAGS to -g if not set.
* Makefile.in: Have CFLAGS and LDFLAGS substituted from configure.
- * lib/Makefile.in: Have CFLAGS substituted from configure.
+ * lib/Makefile.in: Have CFLAGS substituted from configure.
Reported by Eric Backus and Tom McConnell.
* configure.in: m4_undefine changeword before using AC_ENABLE.
@@ -645,7 +663,7 @@ Thu Jun 23 00:00:30 1994 Francois Pinard (pinard@icule)
[These modifs all depend upon ENABLE_CHANGEWORD and are adapted
from code provided by Pete Chown]
* m4.h: Add original_text field to u_t variant of union u.
- Declare TOKEN_DATA_FUNC macro.
+ Declare TOKEN_DATA_FUNC macro.
* builtin.c: Declare changeword.
(m4_changeword): New function.
* input.c: Include "regex.h", define variables with word regexps.
@@ -732,7 +750,7 @@ Wed May 4 23:59:39 1994 Francois Pinard (pinard@icule)
* Makefile.in: Remove all occurrences of $(MFLAGS), which were
bringing more evil than good on a few systems.
- Reported by Greg A. Woods.
+ Reported by Greg A. Woods.
Fri Apr 22 15:59:35 1994 Francois Pinard (pinard@icule)
@@ -1073,7 +1091,7 @@ Mon Nov 1 07:45:24 1993 Francois Pinard (pinard@icule)
* m4.c: Remove all code conditionalized by IMPLEMENT_M4OPTS.
Merge parse_args into main. Declare argv to be `char *const *',
- then remove superfluous casts.
+ then remove superfluous casts.
* m4.c: Rename --no-gnu-extensions to --traditional.
Reported by Ben A. Mesander.
@@ -1414,7 +1432,7 @@ Thu Nov 5 12:37:13 1992 Francois Pinard (pinard at icule)
* Many *.[hc] files: Correct intra-line spacing here and there,
according to GNU indent 1.6 advice.
-
+
* configure.in: New, using Autoconf 1.2.
* m4.h: Reverse NO_MEMORY_H to NEED_MEMORY_H.
* Delete old configure.in, configure, etc/configure.in,
diff --git a/NEWS b/NEWS
index 4ee8f042..e798e58d 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,10 @@ Copyright (C) 1992, 1993, 1994, 2004 Free Software Foundation, Inc.
Version 1.4.2 - ???, by ???
+Version 1.4.2 - August 2004, by Paul Eggert
+
+* No user visible changes; portability bug fixes only.
+
Version 1.4.1 - June 2004, by Paul Eggert
* maketemp now creates an empty file with the given name, instead of merely
diff --git a/config.h.in b/config.h.in
index 3be365a5..935ff994 100644
--- a/config.h.in
+++ b/config.h.in
@@ -166,5 +166,5 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
diff --git a/configure b/configure
index b6319e3d..b48992f9 100755
--- a/configure
+++ b/configure
@@ -1317,7 +1317,7 @@ rm conftest.sed
PRODUCT=m4
-VERSION=1.4.1a
+VERSION=1.4.2
cat >>confdefs.h <<_ACEOF
#define PRODUCT "$PRODUCT"
_ACEOF
diff --git a/configure.in b/configure.in
index 8a33d65a..c1d37587 100644
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@ AC_CONFIG_HEADER(config.h)
AC_ARG_PROGRAM
PRODUCT=m4
-VERSION=1.4.1a
+VERSION=1.4.2
AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PRODUCT)
@@ -36,7 +36,7 @@ AC_FUNC_VPRINTF
AC_REPLACE_FUNCS(strtol)
AC_MSG_CHECKING(ecvt declaration)
AC_EGREP_HEADER(ecvt, stdlib.h,
- [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_EFGCVT, 2)],
+ [AC_MSG_RESULT(yes); AC_DEFINE(HAVE_EFGCVT, 2)],
[AC_MSG_RESULT(no); AC_CHECK_FUNCS(ecvt)])
AC_MSG_CHECKING(if stack overflow is detectable)
diff --git a/doc/m4.info b/doc/m4.info
index 9b66a7e7..f52d2259 100644
--- a/doc/m4.info
+++ b/doc/m4.info
@@ -41,7 +41,7 @@ changes by Franc,ois Pinard and other volunteers on the Internet. All
names and email addresses can be found in the file `THANKS' from the
GNU `m4' distribution.
- This is release 1.4.1. It is now to be considered stable, future
+ This is release 1.4.2. It is now to be considered stable, future
releases are only meant to fix bugs, increase speed, or improve
documentation. However...
@@ -2923,8 +2923,8 @@ Concept index
* Menu:
-* Arguments to macros: Arguments. (line 6)
* arguments to macros: Macro Arguments. (line 6)
+* Arguments to macros: Arguments. (line 6)
* arguments to macros, special: Pseudo Arguments. (line 6)
* arguments, quoted macro: Quoting Arguments. (line 6)
* arithmetic: Arithmetic. (line 6)
@@ -2970,8 +2970,8 @@ Concept index
* expressions, evaluation of integer: Eval. (line 6)
* extracting substrings: Substr. (line 6)
* fast loading of frozen files: Frozen files. (line 6)
-* file inclusion <1>: Undivert. (line 53)
-* file inclusion: File Inclusion. (line 6)
+* file inclusion <1>: File Inclusion. (line 6)
+* file inclusion: Undivert. (line 53)
* filenames, on the command line: Invoking m4. (line 176)
* files, diverting output to: Divert. (line 6)
* files, names of temporary: Maketemp. (line 6)
@@ -2979,21 +2979,21 @@ Concept index
* formatted output: Format. (line 6)
* frozen files for fast loading: Frozen files. (line 6)
* GNU extensions <1>: Extensions. (line 6)
-* GNU extensions <2>: Frozen files. (line 6)
-* GNU extensions <3>: Esyscmd. (line 6)
-* GNU extensions <4>: Format. (line 6)
-* GNU extensions <5>: Patsubst. (line 6)
-* GNU extensions <6>: Regexp. (line 6)
+* GNU extensions <2>: Debug Levels. (line 59)
+* GNU extensions <3>: Debug Output. (line 6)
+* GNU extensions <4>: Frozen files. (line 6)
+* GNU extensions <5>: Format. (line 6)
+* GNU extensions <6>: Patsubst. (line 6)
* GNU extensions <7>: Undivert. (line 53)
-* GNU extensions <8>: Search Path. (line 6)
-* GNU extensions <9>: Debug Output. (line 6)
-* GNU extensions <10>: Debug Levels. (line 59)
+* GNU extensions <8>: Arguments. (line 28)
+* GNU extensions <9>: Esyscmd. (line 6)
+* GNU extensions <10>: Regexp. (line 6)
* GNU extensions <11>: Builtin. (line 6)
-* GNU extensions <12>: Indir. (line 6)
-* GNU extensions: Arguments. (line 28)
+* GNU extensions <12>: Search Path. (line 6)
+* GNU extensions: Indir. (line 6)
* included files, search path for: Search Path. (line 6)
-* inclusion, of files <1>: Undivert. (line 53)
-* inclusion, of files: File Inclusion. (line 6)
+* inclusion, of files <1>: File Inclusion. (line 6)
+* inclusion, of files: Undivert. (line 53)
* increment operator: Incr. (line 6)
* indirect call of builtins: Builtin. (line 6)
* indirect call of macros: Indir. (line 6)
@@ -3035,8 +3035,8 @@ Concept index
* quoted string: Quoted strings. (line 6)
* recursive macros: Loops. (line 6)
* redefinition of macros, temporary: Pushdef. (line 6)
-* regular expressions <1>: Patsubst. (line 6)
-* regular expressions: Regexp. (line 6)
+* regular expressions <1>: Regexp. (line 6)
+* regular expressions: Patsubst. (line 6)
* reloading a frozen file: Frozen files. (line 6)
* renaming macros: Defn. (line 6)
* running UNIX commands: UNIX commands. (line 6)
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 9c3260be..5843e66c 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1 +1 @@
-Thu Jun 3 14:51:32 PDT 2004
+Sat Aug 21 11:36:49 BST 2004
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index ed6446df..4ebfe6f4 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -24,7 +24,7 @@
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.1.1.1.2.1 $
+\deftexinfoversion$Revision: 1.1.1.1.2.2 $
\message{Loading texinfo package [Version \texinfoversion]:}
% Print the version number if in a .fmt file.
diff --git a/doc/version.texi b/doc/version.texi
index f210529b..fdd60708 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,3 +1,3 @@
-@set EDITION 1.4.1
-@set UPDATED June 2004
-@set VERSION 1.4.1
+@set EDITION 1.4.2
+@set UPDATED August 2004
+@set VERSION 1.4.2
diff --git a/src/builtin.c b/src/builtin.c
index bc614e55..fb1d5f5e 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1,6 +1,6 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000 Free
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000, 2004 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -767,6 +767,7 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
return;
debug_flush_files ();
+ errno = 0;
pin = popen (ARG (1), "r");
if (pin == NULL)
{
@@ -1081,6 +1082,7 @@ m4_maketemp (struct obstack *obs, int argc, token_data **argv)
int fd;
if (bad_argc (argv[0], argc, 2, 2))
return;
+ errno = 0;
if ((fd = mkstemp (ARG (1))) < 0)
{
M4ERROR ((warning_status, errno, "Cannot create tempfile %s", ARG (1)));
diff --git a/src/m4.c b/src/m4.c
index 0d7c8a0c..9897c88c 100644
--- a/src/m4.c
+++ b/src/m4.c
@@ -1,5 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -91,8 +93,10 @@ typedef struct macro_definition macro_definition;
void
reference_error (void)
{
+ int e = errno;
fflush (stdout);
fprintf (stderr, "%s:%d: ", current_file, current_line);
+ errno = e;
}
#ifdef USE_STACKOVF
diff --git a/src/output.c b/src/output.c
index ded99a32..689ff5d7 100644
--- a/src/output.c
+++ b/src/output.c
@@ -1,5 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -467,12 +469,15 @@ insert_file (FILE *file)
/* Insert output by big chunks. */
- errno = 0;
- while (length = fread (buffer, 1, COPY_BUFFER_SIZE, file),
- length != 0)
- output_text (buffer, length);
- if (errno)
- M4ERROR ((EXIT_FAILURE, errno, "ERROR: Reading inserted file"));
+ for (;;)
+ {
+ length = fread (buffer, 1, COPY_BUFFER_SIZE, file);
+ if (ferror (file))
+ M4ERROR ((EXIT_FAILURE, errno, "ERROR: Reading inserted file"));
+ if (length == 0)
+ break;
+ output_text (buffer, length);
+ }
}
/*-------------------------------------------------------------------------.
diff --git a/src/path.c b/src/path.c
index 90bdc6de..02c8af2f 100644
--- a/src/path.c
+++ b/src/path.c
@@ -1,5 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93 Free Software Foundation, Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 2004 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -102,6 +104,7 @@ path_search (const char *dir)
FILE *fp;
includes *incl;
char *name; /* buffer for constructed name */
+ int e;
/* Look in current working directory first. */
fp = fopen (dir, "r");
@@ -111,6 +114,7 @@ path_search (const char *dir)
/* If file not found, and filename absolute, fail. */
if (*dir == '/' || no_gnu_extensions)
return NULL;
+ e = errno;
name = (char *) xmalloc (dir_max_length + 1 + strlen (dir) + 1);
@@ -133,6 +137,7 @@ path_search (const char *dir)
}
}
xfree (name);
+ errno = e;
return fp;
}
diff --git a/stamp-h.in b/stamp-h.in
index b7924646..5843e66c 100644
--- a/stamp-h.in
+++ b/stamp-h.in
@@ -1 +1 @@
-Thu Jun 3 14:51:31 PDT 2004
+Sat Aug 21 11:36:49 BST 2004