summaryrefslogtreecommitdiff
path: root/usr.bin/m4/eval.c
Commit message (Collapse)AuthorAgeFilesLines
* m4: import from OpenBSDBaptiste Daroussin2019-09-091-2/+2
| | | | | | | | | | | By deraadt@ mkstemp() returns -1 on failure Obtained from: OpenBSD Notes: svn path=/head/; revision=352070
* m4: import from OpenBSDBaptiste Daroussin2019-09-091-12/+31
| | | | | | | | | | | | | | | | | | patch by espie@ replace sloppy parsing of numeric values with strtonum (incr, decr, divert) still use integers, so use the natural bounds for these. POSIX says m4 should error when these use non numeric values, and now they do. okay millert@ Obtained from: OpenBSD Notes: svn path=/head/; revision=352069
* m4: import patch from OpenBSDBaptiste Daroussin2019-09-091-9/+8
| | | | | | | | | | | | | | | | | | by espie@ ifelse is special, fix argv parsing to avoid segfault problem noticed by Matthew Green (netbsd), slightly different fix so that argc counting makes more sense. we might want to warn on wrong number of parameters later, but this is somewhat inconsistent depending on the builtin right now. okay millert@ Obtained from: OpenBSD Notes: svn path=/head/; revision=352068
* Import from OpenBSD: -E flagBaptiste Daroussin2019-09-091-1/+5
| | | | | | | | | | | | | Add -E flag (make warnings fatal), following the behavior of GNU m4 1.4.9+ Help and direction millert@ espie@ anton@ deraadt@ ok espie@ Obtained from: OpenBSD Notes: svn path=/head/; revision=352065
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-1/+3
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* usr.bin: minor spelling fixes on comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298879
* Synchronize m4(1) with OpenBSDBaptiste Daroussin2015-11-211-2/+2
| | | | Notes: svn path=/head/; revision=291128
* Sync with OpenBSDBaptiste Daroussin2014-07-271-8/+8
| | | | | | | | | | | This brings: - check for integer overflows in custom allocs - fix potential integer overflows in memory allocation - annotate regexp error messages with source string - better error handling in mkstemp/unlink/fdopen logic Notes: svn path=/head/; revision=269162
* Reduce diff with upstream.Jung-uk Kim2013-05-031-1/+1
| | | | Notes: svn path=/head/; revision=250226
* Improve m4 compatibility with GNU m4 extension ** (exponent)Baptiste Daroussin2012-04-151-2/+3
| | | | | | | | Submitted by: Marc Espie (espie@OpenBSD.org) Approved by: des@ (mentor) Notes: svn path=/head/; revision=234310
* Unbreak the build after r228697 adding the { } block to make clear whichBjoern A. Zeeb2011-12-191-1/+2
| | | | | | | if the else belongs to. Notes: svn path=/head/; revision=228701
* Reimplement support for the ** (exponent) gnu extension, make it available ↵Baptiste Daroussin2011-12-181-2/+6
| | | | | | | | | | | thought the -g (mimic gnu) option Reviewed by: cognet Approved by: cognet Discussed with: espie@OpenBSD.org (upstream) Notes: svn path=/head/; revision=228697
* Synchronize with laster version of m4 from OpenBSD and NetBSDBaptiste Daroussin2011-11-281-218/+167
| | | | | | | | | | | This bring better compatibility with gnum4 Reviewed by: cognet Approved by: cognet Obtained from: OpenBSD, NetBSD Notes: svn path=/head/; revision=228063
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-12-111-4/+0
| | | | | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson Notes: svn path=/head/; revision=216370
* Store a pointer to "null" in struct ndblock's defn member instead of aTim J. Robbins2004-08-161-3/+3
| | | | | | | | | | | duplicate allocated on the heap; the address defn points to is significant, and is checked against the address of "null" in certain conditionals. PR: 59883 MFC after: 1 week Notes: svn path=/head/; revision=133858
* Flush streams before calling system() so that the output appears in theTim J. Robbins2003-05-011-1/+3
| | | | | | | | right place in the output stream when redirected to a file (when full buffering is enabled). Noticed by schweikh on freebsd-standards. Notes: svn path=/head/; revision=114368
* Kill extraneous whitespace.Juli Mallett2002-07-151-12/+12
| | | | Notes: svn path=/head/; revision=100014
* Revert vendor identifiers, and #if 0 what is #if 0/#else for OpenBSD.Juli Mallett2002-05-031-2/+10
| | | | | | | | | Add __FBSDID() properly. Requested by: bde, mike Notes: svn path=/head/; revision=95982
* Merge local changes again, against ANSIfied m4(1).Juli Mallett2002-05-011-68/+24
| | | | Notes: svn path=/head/; revision=95887
* Crank WARNS.Juli Mallett2002-04-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Cast sizeof() to (int), as it's being compared against an int, not a size_t. If i is changed to a size_t, it means the logic must be slightly changed later in the flow, where --i is checked to be >= 0. I am not sure I want to make a logic change to account for clearing up a warning, when an aesthetic one will keep from modifying the logic. Other harmless casts, that I think I've made in the right directions. Make gpbc() an inline function, rather than an obfuscated macro, make its scratch space local, rather than global. The previous macro used a dirty hack (logical AND in place of a conditional) which would lead GCC to throw a fit (rightly so) as the logical check, as well as the incrementation of a variable, were not used for anything. const'ify a few places where gcc3 yells. xstrdup() some global consts in places where we xstrdup() when not using consts, but tried to assign them to non-consts before. Don't use execv(2) if we don't have the kind of arguments it wants. Reviewed by: asmodai obrien tjr Submitted by: tjr (a gcc3 build log) Notes: svn path=/head/; revision=95095
* Bring OpenBSD m4(1) off of the OPENBSD vendor branch, and add the -s option,Juli Mallett2002-04-191-192/+464
| | | | | | | | | | $FreeBSD$ identifiers, and fix initialisation to stderr to happen in a function as stderr is not the same in CURRENT as in OpenBSD. Reviewed by: obrien Notes: svn path=/head/; revision=95060
* This adds support for -s to the m4(1) utility, which causes #line directivesJuli Mallett2002-04-171-0/+6
| | | | | | | | | | | | | to be emitted as per the C preprocessor. It updates the manual page in regards to standards accordingly. PR: standards/36075 Submitted by: tjr Reviewed by: mike MFC after: 1 week Notes: svn path=/head/; revision=94957
* Remove the local basename in favor of the libc version.David E. O'Brien2001-07-241-3/+8
| | | | | | | Remove xmalloc and xstrdup and do the error checking at the place of use. Notes: svn path=/head/; revision=80289
* Make sure the len() builtin always returns an answer. Previously,Gregory Neil Shapiro2001-05-291-2/+1
| | | | | | | | | | len(`') didn't return an answer. Now it returns 0. PR: bin/12942 MFC after: 5 days Notes: svn path=/head/; revision=77378
* String operations could silently truncate long strings, leaving the outputGregory Neil Shapiro2001-05-181-8/+8
| | | | | | | | | | | | | | corrupted. Mark's patch fixes this be removing the MAXTOK limitation on substring operations and allowing the putback buffer size to be the limiting factor. If the putback buffer size if reached, m4 gives an error instead of silently truncating the string. PR: bin/26619 Submitted by: Mark Peek <mark-ml@whistle.com> MFC after: 5 days Notes: svn path=/head/; revision=76822
* Fix format string warnings.Kris Kennaway2000-11-271-1/+1
| | | | | | | | Submitted by: nra Obtained from: NetBSD Notes: svn path=/head/; revision=69246
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Make the builtin unix macro work as it should (well like Solaris's,Steve Price1998-09-071-1/+5
| | | | | | | GNU's, and OSF1's). Notes: svn path=/head/; revision=38926
* divnum is no longer silently restricted to the range 0..9. (cf: 4098)Jonathan Lemon1997-08-181-3/+7
| | | | | | | | | | | changequote(,) is now a synonym for changequote(). (cf: 803) buffer size for translit() enlarged to handle a full string PR: 803, 4098 Notes: svn path=/head/; revision=28386
* Use err(3) instead of local redefinition. Remove progname.Philippe Charnier1997-07-231-11/+15
| | | | Notes: svn path=/head/; revision=27625
* Make the $@ macro behave as described in the man page.Joerg Wunsch1997-04-131-0/+10
| | | | | | | | | This patch has been submitted by Andreas Burmester (i think) on the German Usenet long ago. Andreas told me that our m4 has quite more subtle bugs, so we might consider using NGU m4 instead. Notes: svn path=/head/; revision=24901
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-5/+5
| | | | Notes: svn path=/head/; revision=8874
* 1) kill temp diver upon exitAndrey A. Chernov1995-04-161-0/+1
| | | | | | | | 2) add logical ops, fix ! precedence, implement unary +, fix exp Obtained from: NetBSD Notes: svn path=/head/; revision=7896
* Fix syscmd() output out of syncAndrey A. Chernov1995-03-111-1/+4
| | | | | | | Submitted by: smp@clem.systemsix.com Notes: svn path=/head/; revision=7004
* Make m4 more 8bit clean.Andrey A. Chernov1994-12-181-3/+3
| | | | | | | | | Don't use is*(EOF) This fix core dump when LANG setted to 8bit wide charset and ENABLE_STARTUP_LOCALE Notes: svn path=/head/; revision=5165
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+789
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590