OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.47 / (download) - annotate - [select for diffs], Thu Jun 15 13:48:42 2017 UTC (6 years, 11 months ago) by bcallah
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, 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, HEAD
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (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.46 / (download) - annotate - [select for diffs], Mon Dec 7 14:12:46 2015 UTC (8 years, 5 months ago) by espie
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
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored)

Yet another missed ferror call

Revision 1.45 / (download) - annotate - [select for diffs], Sun Dec 21 09:33:12 2014 UTC (9 years, 5 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

fix test-redef2:
- introduce explicit STORAGE classes for the shadow stack entries
- delay freeing definitions if they're in-use, keep them in a simple array.

okay millert@

Revision 1.44 / (download) - annotate - [select for diffs], Mon May 12 19:11:19 2014 UTC (10 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.43: +6 -20 lines
Diff to previous 1.43 (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.43 / (download) - annotate - [select for diffs], Mon Apr 28 12:34:11 2014 UTC (10 years ago) by espie
Branch: MAIN
Changes since 1.42: +57 -3 lines
Diff to previous 1.42 (colored)

check for integer overflows in custom allocs, okay jca@

Revision 1.42 / (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_5_BASE, OPENBSD_5_5, 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, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.41: +15 -15 lines
Diff to previous 1.41 (colored)

Remove stray spaces.  No code change.

Revision 1.41 / (download) - annotate - [select for diffs], Wed Oct 14 17:19:47 2009 UTC (14 years, 7 months ago) by sthen
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Support the -P option from gnu m4, which prefixes builtins with the
string m4_. Feedback from jmc@, Tobias Ulmer, Matthew Dempsky - thanks!
ok espie@

Revision 1.40 / (download) - annotate - [select for diffs], Thu Aug 21 20:59:14 2008 UTC (15 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.39: +9 -9 lines
Diff to previous 1.39 (colored)

use unsigned char for buffers, allow differentiating between EOF and y".

okay otto@

Revision 1.39 / (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.38: +8 -8 lines
Diff to previous 1.38 (colored)

not yet, committed too much

Revision 1.38 / (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.37: +9 -9 lines
Diff to previous 1.37 (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.37 / (download) - annotate - [select for diffs], Sat May 5 03:42:49 2007 UTC (17 years ago) by ray
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
Changes since 1.36: +7 -6 lines
Diff to previous 1.36 (colored)

Localize variables and don't do anything after exit().

OK espie@, moritz@, and jaredy@.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Dec 12 21:16:18 2006 UTC (17 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.35: +4 -2 lines
Diff to previous 1.35 (colored)

tweak previous, and update usage(); ok grunk

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

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

okay miod@

Revision 1.34 / (download) - annotate - [select for diffs], Wed Sep 7 13:22:24 2005 UTC (18 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

sort options and sync usage()

Revision 1.33 / (download) - annotate - [select for diffs], Tue Sep 6 15:33:21 2005 UTC (18 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.32: +11 -10 lines
Diff to previous 1.32 (colored)

finally make our m4 SusV3-compliant.

- changecom and changequote have a simple definition (that matches gnu-m4,
coincidentally, so we no longer need two distinct modes for these)

- off-by-one bug in -s, this finally works.

- reorder main parser loop, so that we can use alphabetic constructs in
quotes/comments.

- rename putback to pushback, this matches comments, and makes more sense.

- more uniform (and updated) description of changequote/changecom.

- new, systematic regression tests of comments/quotes.

- framework to test -s: one perl script to reconstitute `full' files with
all line numbers, so that we can verify the output without needing a
complete match.

okay otto@, fries@

Revision 1.32 / (download) - annotate - [select for diffs], Sat Aug 6 16:22:26 2005 UTC (18 years, 9 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.31: +1 -9 lines
Diff to previous 1.31 (colored)

zap rcsid. It's not ramdisk, but they still take space.

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
Changes since 1.30: +24 -4 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], Mon Nov 17 17:12:10 2003 UTC (20 years, 6 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.29: +42 -15 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:10 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.28: +3 -7 lines
Diff to previous 1.28 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.28 / (download) - annotate - [select for diffs], Sun Apr 28 14:37:12 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.27: +12 -3 lines
Diff to previous 1.27 (colored)

Implement -s.
Triggered by recent FreeBSD changes.

- emits #line directives at every file change (like FreeBSD)
- maintains a synch_lineno variable to verify when the output gets out
of synch with the input, so that it can emit #line to re-synch as well
(unlike FreeBSD)

To do: either handle \end-of-line, or recognize when a macro expansion
is in progress, so that line synch don't perturb cpp on multi-line
expansions.

With this, we should have a fully POSIX-compliant m4.

ok miod@

Revision 1.27 / (download) - annotate - [select for diffs], Fri Apr 26 16:15:16 2002 UTC (22 years ago) by espie
Branch: MAIN
Changes since 1.26: +19 -40 lines
Diff to previous 1.26 (colored)

use ansi function declarations. ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Fri Nov 16 23:50:40 2001 UTC (22 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.25: +3 -3 lines
Diff to previous 1.25 (colored)

incorrect write

Revision 1.25 / (download) - annotate - [select for diffs], Wed Oct 10 11:17:37 2001 UTC (22 years, 7 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.24: +4 -2 lines
Diff to previous 1.24 (colored)

Quote filename properly.

Revision 1.24 / (download) - annotate - [select for diffs], Wed Sep 19 13:14:18 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.23: +6 -8 lines
Diff to previous 1.23 (colored)

inline some very common putback/chrsave. Worth roughly 10%

Revision 1.23 / (download) - annotate - [select for diffs], Tue Sep 18 15:46:39 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

better end-condition, fix tracing of dnl.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Sep 18 14:43:23 2001 UTC (22 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.21: +24 -2 lines
Diff to previous 1.21 (colored)

instrumentation for tracing mode: macro expansion

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jul 18 16:18:17 2001 UTC (22 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.20: +5 -3 lines
Diff to previous 1.20 (colored)

Kill signal race. Reviewed by jjbg@

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 27 17:44:33 2000 UTC (23 years, 9 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.19: +19 -3 lines
Diff to previous 1.19 (colored)

Handle unlimited diverts for m4 -g.

Problem with autoconf noticed by d@

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jul 2 01:17:00 2000 UTC (23 years, 10 months ago) by espie
Branch: MAIN
Changes since 1.18: +9 -30 lines
Diff to previous 1.18 (colored)

Make the m4 machine stack dynamically sized.

Fix strspace automatic extension.
The assumption that simply updating the current pointer works is false,
there are cases where previous entries on the stack would absorp vast
amounts of string space, and overload the non-updated entries.

To fix it, we use a shadow copy of the stack, which only records which
entries are pointers within strspace, so that a resize can adjust all
those pointers at once.

Reviewed by millert@

Revision 1.18 / (download) - annotate - [select for diffs], Sat Mar 11 15:54:44 2000 UTC (24 years, 2 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.17: +29 -3 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Sat Jan 15 14:26:00 2000 UTC (24 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.16: +21 -16 lines
Diff to previous 1.16 (colored)

There is no need to waste short for holding EOF in the pushback buffer.
Now that the input_file structure is sufficiently fleshed out, just stop
EOF at the putback level, and make sure files at EOF STAY at EOF.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jan 13 17:35:10 2000 UTC (24 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.15: +6 -3 lines
Diff to previous 1.15 (colored)

Record 50 levels of open parenthesis, open quotes, to give a post-mortem.
- no need to record more, as this is just for diagnosis purpose. This
doesn't affect m4's main engine.
- don't free file names as a compromise: the only other options would be
to ref count them (not worth the complexity) or dup them systematically (ick).

Revision 1.15 / (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.14: +33 -2 lines
Diff to previous 1.14 (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.14 / (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.13: +7 -7 lines
Diff to previous 1.13 (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.13 / (download) - annotate - [select for diffs], Wed Nov 17 14:51:05 1999 UTC (24 years, 6 months ago) by espie
Branch: MAIN
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

Night of the moronic coder, part 2.

repairs patterns such as
divert(6)
divert(7)
undivert(6)
divert(6)

which are not that frequent, but were *quite* thoroughly broken...

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 14 08:35:17 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.11: +20 -20 lines
Diff to previous 1.11 (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.11 / (download) - annotate - [select for diffs], Tue Sep 14 08:21:37 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

Implement -I option and M4PATH environment variable

Revision 1.10 / (download) - annotate - [select for diffs], Thu Sep 9 22:18:19 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.9: +3 -3 lines
Diff to previous 1.9 (colored)

Bug-fix: thinko

Revision 1.9 / (download) - annotate - [select for diffs], Mon Sep 6 13:29:32 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.8: +104 -20 lines
Diff to previous 1.8 (colored)

Remove STRSPACE limitations.
A bit wasteful, but not too intrusive.

Also remove pushback buffer limitations, as this would be mostly useless
otherwise.

Incidentally, pushback buffer overflow detection in pbstr was wrong.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Sep 6 13:20:40 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.7: +3 -22 lines
Diff to previous 1.7 (colored)

Get rid of mktemp in the handling of diversion.

Simply put, mkstemp/unlink/rewind has the proper semantics under Unix,
and so we don't have to keep track about temp file names and remove them.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Sep 6 13:10:49 1999 UTC (24 years, 8 months ago) by espie
Branch: MAIN
Changes since 1.6: +23 -65 lines
Diff to previous 1.6 (colored)

Misc minor changes:
- use err.h and kill oops,
- use __progname and kill basename,
- let indx use strstr
- proper EOS decl

Revision 1.6 / (download) - annotate - [select for diffs], Wed Dec 10 20:24:17 1997 UTC (26 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

cgd: add a typedef which describes elements in the push-back buffer.  Make
that typedef 'short'.  'char' (which was previously used) because char
may be unsigned and ((char)EOF) != EOF if that is the case.  That was
causing the (char)EOF (0xff) pushed back in main to be interepreted as
a character, and, in some cases, to be written to the output.  'short'
was used rather than 'signed char' because if the latter is used,
0xff characters in the input would confuse m4.  (No point in introducing
(more?) 8-bit lossage.)

Revision 1.5 / (download) - annotate - [select for diffs], Fri Jul 25 21:05:32 1997 UTC (26 years, 10 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.4: +5 -5 lines
Diff to previous 1.4 (colored)

#if __STDC__ --> #ifdef __STDC__

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jul 1 20:40:28 1996 UTC (27 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.3: +4 -10 lines
Diff to previous 1.3 (colored)

undo mktemp cleanup until i get it right

Revision 1.3 / (download) - annotate - [select for diffs], Wed Jun 26 05:36:15 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

rcsid

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jun 25 20:50:08 1996 UTC (27 years, 11 months ago) by deraadt
Branch: MAIN
Changes since 1.1: +8 -2 lines
Diff to previous 1.1 (colored)

mktemp open + fdopen

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:45:36 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:45:36 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

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.