OpenBSD CVS

CVS log for src/usr.bin/m4/gnum4.c


[BACK] Up to [local] / src / usr.bin / m4

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.54 / (download) - annotate - [select for diffs], Mon Jul 4 10:41:21 2022 UTC (22 months, 2 weeks ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.53: +12 -21 lines
Diff to previous 1.53 (colored)

somehow, when I created this file, I copied the licence of the other files
around, but with my name instead... which makes absolutely no sense
whatsoever, especially the regents part.

replace with ISC licence, much saner.

(as noticed by miod@, who else ?)

Revision 1.53 / (download) - annotate - [select for diffs], Tue Jun 14 15:15:17 2022 UTC (23 months ago) by espie
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored)

my email should be @openbsd.org everywhere, and nothing else

Revision 1.52 / (download) - annotate - [select for diffs], Mon Aug 21 21:41:13 2017 UTC (6 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.51: +6 -4 lines
Diff to previous 1.51 (colored)

Use waitpid()/EINTR idiom for the specific pid, rather than generic wait(),
in case the parent process was started with a dangling child.  This style
ensures any potential parent:child interlock isn't disrupted due to the
"wrong" child being waited on first.  Then the other other childs can safely
zombie.
ok millert jca brynet

Revision 1.51 / (download) - annotate - [select for diffs], Thu Jun 15 13:48:42 2017 UTC (6 years, 11 months ago) by bcallah
Branch: MAIN
Changes since 1.50: +24 -5 lines
Diff to previous 1.50 (colored)

Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+
Help and direction millert@ espie@ anton@ deraadt@

ok espie@

Revision 1.50 / (download) - annotate - [select for diffs], Wed Apr 29 00:13:26 2015 UTC (9 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.49: +2 -1 lines
Diff to previous 1.49 (colored)

Add missing #include <stdint.h> for SIZE_MAX

Revision 1.49 / (download) - annotate - [select for diffs], Sat Apr 25 15:33:47 2015 UTC (9 years ago) by espie
Branch: MAIN
Changes since 1.48: +5 -2 lines
Diff to previous 1.48 (colored)

add check for overflow while doubling (very unlikely in practice, but still
better style code). Problem noticed by deraadt@ in m4.

okay doug@ deraadt@

Revision 1.48 / (download) - annotate - [select for diffs], Sat Mar 14 23:00:43 2015 UTC (9 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.47: +3 -7 lines
Diff to previous 1.47 (colored)

Use xstrdup(), from Michael W. Bombardieri
OK espie@

Revision 1.47 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:09 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.46 / (download) - annotate - [select for diffs], Thu Jul 10 14:12:31 2014 UTC (9 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.45: +29 -22 lines
Diff to previous 1.45 (colored)

annotate regexp error messages with source string.
okay miod@

Revision 1.45 / (download) - annotate - [select for diffs], Mon May 12 19:11:19 2014 UTC (10 years ago) by espie
Branch: MAIN
Changes since 1.44: +4 -3 lines
Diff to previous 1.44 (colored)

adjust to ohash being in libutil now, and to the interface changes.
fix potential integer overflows in memory allocation (mostly for pedagogical
purposes, these are unlikely to overflow in practice)
move the rest of lst.lib stuff into its own directory.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Apr 28 12:34:11 2014 UTC (10 years ago) by espie
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored)

check for integer overflows in custom allocs, okay jca@

Revision 1.43 / (download) - annotate - [select for diffs], Wed Nov 20 16:44:27 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored)

repair signed char vs isdigit
ok espie

Revision 1.42 / (download) - annotate - [select for diffs], Sun Nov 6 12:25:43 2011 UTC (12 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

improve gm4 compatibility, from Robert Young, thanks !
note that patsubst is non-standard.
okay miod@, deraadt@

Revision 1.41 / (download) - annotate - [select for diffs], Tue Sep 7 19:58:09 2010 UTC (13 years, 8 months ago) by marco
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.40: +36 -36 lines
Diff to previous 1.40 (colored)

Remove stray spaces.  No code change.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Mar 22 20:40:43 2010 UTC (14 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.39: +10 -3 lines
Diff to previous 1.39 (colored)

add more gnum4 support: regexps do weird things with empty patterns (this
is required for newer autoconf).
fix the tokenizer for gnu extensions, allowing digits out of range is
ridiculous.
add POSIX2008 mkstemp and document it (also documenting that mktemp is
safe, not posix...)
tidy the manpage, do extra .Nm m4 -> .Nm.
okay otto@, miod@, jmc@

Revision 1.39 / (download) - annotate - [select for diffs], Thu Aug 21 21:01:04 2008 UTC (15 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.38: +72 -30 lines
Diff to previous 1.38 (colored)

extend format support to cater to recent GNU autoconf

okay otto@, some useful ideas from miod@

Revision 1.38 / (download) - annotate - [select for diffs], Sat Aug 16 12:23:50 2008 UTC (15 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.37: +29 -71 lines
Diff to previous 1.37 (colored)

not yet, committed too much

Revision 1.37 / (download) - annotate - [select for diffs], Sat Aug 16 12:21:46 2008 UTC (15 years, 9 months ago) by espie
Branch: MAIN
Changes since 1.36: +72 -30 lines
Diff to previous 1.36 (colored)

argument parsing should only skip spaces outside of parenthesis.
Inside matching parenthesis, keep spaces as is (use chrsave instead of
pbstr, since there's no way it can be a further macro expansion).
Fixes a long-standing issue with autoconf (   --option -> --option),
matches other m4 than gnum4

okay millert@, fries@

Revision 1.36 / (download) - annotate - [select for diffs], Fri Mar 24 08:03:44 2006 UTC (18 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

oops, noticed by David Hill.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 23 08:04:54 2006 UTC (18 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.34: +8 -7 lines
Diff to previous 1.34 (colored)

formatting fixes

Revision 1.34 / (download) - annotate - [select for diffs], Thu Mar 23 07:57:33 2006 UTC (18 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

explicit cast on strtoul, classical const gotcha.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Mar 20 20:27:45 2006 UTC (18 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.32: +47 -1 lines
Diff to previous 1.32 (colored)

add limited support for format builtin in gnu-m4 mode, because I'm fed
up of patching it away in various autoconf derivatives.

okay miod@

Revision 1.32 / (download) - annotate - [select for diffs], Mon Mar 20 10:55:19 2006 UTC (18 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.31: +4 -6 lines
Diff to previous 1.31 (colored)

report function m4errx, that shows app-specific data (filename/linenumber)
before the error message. Use it to simplify code.

okay miod@

Revision 1.31 / (download) - annotate - [select for diffs], Sun May 29 18:44:36 2005 UTC (18 years, 11 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.30: +16 -1 lines
Diff to previous 1.30 (colored)

fix a few minor compatibility issues.
- let eval() handle a base and number of digits, like it's advertized to.
- in gnu-mode, undivert can take file names as arguments.
- in gnu-mode, map can handle reversed charsets.

Suggestions and okay otto@, mostly prompted by looking at the regress
tests in newer gnu-m4.

Revision 1.30 / (download) - annotate - [select for diffs], Sat May 21 10:33:48 2005 UTC (19 years ago) by espie
Branch: MAIN
Changes since 1.29: +9 -2 lines
Diff to previous 1.29 (colored)

more heuristics to coerce gnu-m4 mode to work like we wish: if a ^ or $
is seen in the regexp, this means we need to take new lines into account.
Otherwise, we don't.

Revision 1.29 / (download) - annotate - [select for diffs], Tue May 17 20:33:26 2005 UTC (19 years ago) by espie
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

gnu m4 mode does not heed end of lines.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Nov 7 10:26:18 2004 UTC (19 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.27: +9 -1 lines
Diff to previous 1.27 (colored)

twiddle + at start of regexp.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Nov 22 11:51:52 2003 UTC (20 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

the the typo. from rohee@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 17 17:12:10 2003 UTC (20 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.25: +7 -10 lines
Diff to previous 1.25 (colored)

Modify xalloc so that it also takes err(3)-like arguments.
Write an xrealloc wrapper that works the same way, and use it as well.

People who feel like it may want to add more explicit error messages to
all the places m4 can fail allocating memory...

okay tedu@

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jun 30 22:13:32 2003 UTC (20 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.24: +7 -5 lines
Diff to previous 1.24 (colored)

Fold trace status into the single hash table that's left.
Inline some macros/functions for speed.
So, this achieves the goal of one single lookup for macro/trace status,
which does speed up m4 in partial tracing situations somewhat.
This does also speed up m4 in large pushdef situations, since it no longer
has to lookup large chains of macros.

okay millert@

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jun 30 22:11:38 2003 UTC (20 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.23: +5 -5 lines
Diff to previous 1.23 (colored)

add a flag for each macro name that records built-in status.
Fold built-in lookup into normal lookup.
okay millert@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jun 30 21:47:21 2003 UTC (20 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.22: +4 -3 lines
Diff to previous 1.22 (colored)

Make the trace status of a macro an actual argument that gets pushed
in the frame for the macro expansion.

(This will allow one single lookup to grab the macro definition and
the trace status)

okay millert@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jun 30 21:42:50 2003 UTC (20 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.21: +3 -3 lines
Diff to previous 1.21 (colored)

clean up internal lookup interface:
define an interface with explicit define/pushdef/popdef... and use it.
That way, most details of the hashtable are no longer visible.

okay millert@

Revision 1.21 / (download) - annotate - [select for diffs], Sun Jun 8 22:42:27 2003 UTC (20 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.20: +7 -3 lines
Diff to previous 1.20 (colored)

Better argv tests, enough to fix autoconf 2.57, apparently.
okay millert@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jun 8 20:11:45 2003 UTC (20 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.19: +25 -15 lines
Diff to previous 1.19 (colored)

Let patsubst handle empty patterns: those match anywhere, and don't
replace any character.
Like gnu-m4 does, and other regexp languages do.

okay fries@

Revision 1.19 / (download) - annotate - [select for diffs], Sat Jun 7 12:02:35 2003 UTC (20 years, 11 months ago) by espie
Branch: MAIN
Changes since 1.18: +3 -2 lines
Diff to previous 1.18 (colored)

Show filename and line number in regexp error.
Okay fries@

Revision 1.18 / (download) - annotate - [select for diffs], Fri Apr 26 16:15:16 2002 UTC (22 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.17: +19 -59 lines
Diff to previous 1.17 (colored)

use ansi function declarations. ok millert@

Revision 1.17 / (download) - annotate - [select for diffs], Fri Apr 26 13:13:41 2002 UTC (22 years ago) by espie
Branch: MAIN
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

prototype mismatch, ansi conversion rules...
add -pedantic to flags.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:48 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.15: +14 -14 lines
Diff to previous 1.15 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Oct 13 20:18:48 2001 UTC (22 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored)

Resize buffer correctly, I'm an idiot.
Found by fries@, ok deraadt@

Revision 1.14 / (download) - annotate - [select for diffs], Fri Sep 28 00:46:02 2001 UTC (22 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.13: +26 -4 lines
Diff to previous 1.13 (colored)

more emacs regexps  in -g mode. Ok millert@

With this, some autoconf 2.52 scripts are now working completely.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 27 12:35:20 2001 UTC (22 years, 7 months ago) by espie
Branch: MAIN
Changes since 1.12: +11 -3 lines
Diff to previous 1.12 (colored)

Needed logic to handle newlines correctly.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 18 13:52:58 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.11: +2 -5 lines
Diff to previous 1.11 (colored)

One single point for all macros/builtin expansion.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Sep 18 13:42:37 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.10: +10 -7 lines
Diff to previous 1.10 (colored)

Fix regexp substitution.
- `vi rule' needs a pointer, because we must distinguish matches as the
string position changes.
- ^ should match only at beginning of line.
- ^ should match at all beginnings of line.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Sep 16 21:08:55 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (colored)

Fix \\ in recognition in patsubst: must advance beyond it as well.

Revision 1.9 / (download) - annotate - [select for diffs], Sat Jul 28 05:36:18 2001 UTC (22 years, 9 months ago) by pvalchev
Branch: MAIN
Changes since 1.8: +1 -2 lines
Diff to previous 1.8 (colored)

Wall cleanup

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jul 24 23:08:25 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.7: +54 -1 lines
Diff to previous 1.7 (colored)

Implement esyscmd

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Wed Jun 28 16:51:24 2000 UTC (23 years, 10 months ago) by jason
Branch: OPENBSD_2_7
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 (colored) next main 1.7 (colored)

Pull in patch from current:
Fix (espie):
Fix stupid bug in argument handling. Problem found by fries@
Jason, that's a candidate for stable...

Revision 1.7 / (download) - annotate - [select for diffs], Wed Jun 28 10:01:27 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.6: +5 -4 lines
Diff to previous 1.6 (colored)

Fix stupid bug in argument handling. Problem found by fries@
Jason, that's a candidate for stable...

Revision 1.6 / (download) - annotate - [select for diffs], Mon Apr 10 17:16:30 2000 UTC (24 years, 1 month ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE
Branch point for: OPENBSD_2_7
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

Thinko in dobuiltin. Reported by turan@

Revision 1.5 / (download) - annotate - [select for diffs], Sat Mar 11 15:54:44 2000 UTC (24 years, 2 months ago) by espie
Branch: MAIN
Changes since 1.4: +326 -1 lines
Diff to previous 1.4 (colored)

Add a few builtins for greater compatibility with gnu-m4, and extended
functionality.
* regular expressions,
* line-number reporting
* `meta'-macros, builtin and indir.

Reviewed by pjanzen@, tested by fries@ and a few others.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jan 12 17:49:53 2000 UTC (24 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.3: +18 -14 lines
Diff to previous 1.3 (colored)

Use a proper abstract interface for file accesses, so that we can record
the file name and line number.

This yields more meaningful error messages, and the possibility for yet
more.

Revision 1.3 / (download) - annotate - [select for diffs], Wed Nov 17 15:34:13 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.2: +8 -3 lines
Diff to previous 1.2 (colored)

Turn warnings on,
Add missing prototypes,
Make local functions static,
Sort extern.h by file,
Constify all char * that can be,
Copy temp file name so that eval does not modify its arguments.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Sep 14 08:35:16 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Style: kill register and indent properly.
Let indx match netbsd flavor, to simplify diffs.
Show how many quotes were not closed.
Increase stack slightly, now that we're no longer bound by argspace.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Sep 14 08:21:36 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN

Implement -I option and M4PATH environment variable

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.