Commit Graph

48 Commits

Author SHA1 Message Date
Todd C. Miller 292d39f7b7
Rename dprintf to DPRINTF and use C99 cpp variadic arguments. (#82)
POSIX specifies a dprintf function that operates on an fd instead of
a stdio stream.  Using upper case for macros is more idiomatic too.
We no longer need to use an extra set of parentheses for debugging
printf statements.
2020-06-25 21:32:34 +03:00
Arnold D. Robbins cef5180110 Fix Issue 78 and apply PR 80. 2020-06-12 14:30:03 +03:00
Arnold D. Robbins 754cf93645 In fldbld(), check that inputFS is set. 2020-06-05 12:25:15 +03:00
Arnold D. Robbins 1107437dce Fix test for use of noreturn. 2020-05-15 15:12:15 +03:00
Arnold D. Robbins 93e5dd87a1 Fix noreturn for old compilers. 2020-04-16 20:56:49 +03:00
Arnold D. Robbins c3d8f9c500 Update FIXES and version date. 2020-04-05 21:14:46 +03:00
awkfan77 bb538fe67e
Replace __attribute__((__noreturn__)) with _Noreturn. (#77)
* Replace __attribute__((__noreturn__)) with _Noreturn.

* Change _Noreturn to noreturn and #include <stdnoreturn.h>
2020-04-05 21:10:52 +03:00
Arnold D. Robbins 2017c2e6ea Fixes from Christo Zoulas. 2020-02-28 13:47:42 +02:00
zoulasc ffee7780fe
3 more fixes (#75)
* LC_NUMERIC radix issue.

According to https://pubs.opengroup.org/onlinepubs/7990989775/xcu/awk.html
The period character is the character recognized in processing awk
programs.  Make it so that during output we also print the period
character, since this is what other awk implementations do, and it
makes sense from an interoperability point of view.

* print "T.builtin" in the error message

* Fix backslash continuation line handling.

* Keep track of RS processing so we apply the regex properly only once
per record.
2020-02-28 13:23:54 +02:00
Arnold D. Robbins e92c8e4d0e Update FIXES, version. 2020-02-19 20:47:40 +02:00
Arnold D. Robbins ed6ff8c1cb Small cleanups before merge to master. 2020-02-18 21:26:24 +02:00
zoulasc 94e4c04561
argument parsing cleanups, dynamic program file allocation, fpe error enhancement. (#72)
* - enhance fpe handler to print the error type
- cleanup argument parsing
- dynamically allocate program filename array

* bison uses enums now, not #define's, make it work with that.

* We need to use either the enums or the defines but not both. This
is because bison -y will create both enums and #defines, while bison
without -y produces only the enums, and byacc produces just #defines.

* fix indentation

* Set the tokentype when we have a match in the scan, and reset it later
when we decide that the match was bad. Fixes nbyacc.

* - don't use pattern rules for portability
- try to move both flavors of generated names for portability

* Amend tests for the new error messages
2020-02-18 21:20:27 +02:00
Arnold D. Robbins 5068d20ef6 Restore zoulas fixes, step 1. 2020-02-06 22:27:31 +02:00
Arnold D. Robbins d7a7e4d147 Revert zoulas changes until we can keep tests passing. 2020-02-06 22:08:20 +02:00
Arnold D. Robbins 8447cc9d47 Update version and FIXES. 2020-02-06 21:47:31 +02:00
Arnold D. Robbins 78c79c06d0 Fix a{0}, update tests. 2020-01-31 08:40:11 +02:00
Arnold D. Robbins 4d9b12969e Update version info. 2020-01-24 11:15:30 +02:00
Arnold D. Robbins de6284e037 Fix Issue 60; sub/gsub follow POSIX if POSIXLY_CORRECT in the environment. 2020-01-19 20:37:33 +02:00
Arnold D. Robbins 3ed74525f6 Update date in version. 2020-01-17 14:03:52 +02:00
Arnold D. Robbins c7eeb57210 Fix merging of concatenated string constants. 2020-01-05 21:18:36 +02:00
Arnold D. Robbins 7db55ba13f Bug fix in interval expressions. 2019-12-27 12:03:35 +02:00
Arnold D. Robbins 0b82bc6eb4 Small edits, update version and FIXES. 2019-12-11 09:24:38 +02:00
Arnold D. Robbins 416c6db5ee Update version and FIXES. 2019-12-08 21:43:32 +02:00
Arnold D. Robbins 108224b484 Convert variables to bool and enum. 2019-11-10 21:19:18 +02:00
Arnold D. Robbins c879fbf013 From Ori Bernstein, ori@eigenstate.org, for FS="" in multibyte locale. 2019-11-08 14:40:18 +02:00
Arnold D. Robbins 2a8f1758b9 Update FIXES and main.c version. 2019-10-25 11:03:02 -04:00
Arnold D. Robbins 961eec1fb5 Additional fixes after merge of PR 53. 2019-10-24 09:42:51 -04:00
Arnold D. Robbins 1633ba1c88 Update FIXES and date in main.c. 2019-10-17 13:06:21 -04:00
Arnold D. Robbins 7cae39dfa5 Make RS as regexp work without ifdef. Add doc, bump version. 2019-10-06 22:34:20 +03:00
Arnold D. Robbins 34a6f41cca Update FIXES and version date in main.c. 2019-09-10 09:57:07 +03:00
Arnold D. Robbins c95b96020f Grammar optimization from NetBSD: Two adjacent string constants are merged. 2019-07-28 20:09:24 +03:00
Arnold D. Robbins 795a06b58c Remove trailing whitespace on lines in all files. 2019-07-28 05:51:52 -06:00
Martijn Dekker 5b602ca8a2 Add support for "\a" and "\v" to regex and command line args (#44)
Support POSIX-specified C-style escape sequences "\a" (alarm)
and "\v" (vertical tab) in command line arguments and regular
expressions, further to the support for them in strings added on
Apr 9, 1989. These now no longer match as literal "a" and "v"
characters (as they don't on gawk and mawk).

IOW, lex.c already supported these (lines 390-391 as of 4e343460);
the support needed to be added to b.c and tran.c.

Relevant POSIX reference:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_04
2019-07-26 11:46:58 +03:00
Arnold D. Robbins 4e34346094 Update FIXES and main.c version. 2019-07-17 21:14:52 +03:00
pfg c70b9fe882 awk: Use random(3) instead of rand(3)
While none of them is considered even near to cryptographic
level, random(3) is a better random generator than rand(3).

Use random(3) for awk as is done in other systems.

Thanks to Chenguang Li for discussing this in the lists
and submitting the patch upstream.

PR:		193147
MFC after:	5 weeks

git-svn-id: svn+ssh://svn.freebsd.org/base/head@271879 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
2019-07-16 22:19:56 +03:00
Arnold D. Robbins b8e0827095 Update FIXES and version in main.c. 2019-07-16 20:54:44 +03:00
Cody Mello ae99b752af Disallow deleting SYMTAB and its elements (#43) 2019-06-17 22:08:54 +03:00
Arnold D. Robbins 28dacbd66b Allow unmatched right paren in regexes. Fixes Issue #40. 2019-06-04 23:53:31 -06:00
Arnold D. Robbins 4189ef5d58 Fix Issue #38 - don't require non-= after = in cmd line assignment. 2019-05-29 21:04:18 +03:00
Martijn Dekker e6ecf52e04 Merge remote-tracking branch 'upstream/master' into interval-expr
main.c: bump version to 20190305
2019-03-05 03:45:40 +01:00
Arnold D. Robbins f25e845cf7 Update version string in main.c. 2019-01-26 21:55:03 +02:00
Martijn Dekker 8a2222286c backport ERE interval/repetition expressions from Apple awk-24
The lack of POSIX interval expressions[*] (a.k.a. bounds, a.k.a.
repetition expressions) in regular expressions is listed under BUGS
in 'awk.1'. Apple's version of onetrueawk has supported these since
at least 2009, judging by the date stamp on their src/b.c in:
https://opensource.apple.com/tarballs/awk/awk-24.tar.gz

A bug report prompted NetBSD to swiftly integrate this code into
their awk. This commit is based on that NetBSD diff.
http://gnats.netbsd.org/53885
f3e4c4ca1d

b.c:
- Backport POSIX-standard interval expressions support in regular
  expressions via NetBSD from Apple awk-24 (20070501).

main.c:
- Bump version ID.

FIXES:
- Add note and credit for this feature.

awk.1: section BUGS:
- Remove line saying interval expressions are not supported.

_________
[*] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04_06
2019-01-23 09:12:27 +00:00
Cody Peter Mello 9b093ea2d0 Flags that begin with "--" should not be treated as end of args 2018-10-09 11:46:57 -07:00
Brian Kernighan 1d9d86418a forgot to update version string 2018-08-27 08:58:33 -04:00
Brian Kernighan 0f4e1ba922 added Arnold's fixes, updates to awktest.tar 2018-08-24 09:09:59 -04:00
Arnold D. Robbins 32093f5bbf Fix multiple long-standing bugs, improve test suite. 2018-08-22 20:40:26 +03:00
Brian Kernighan 3ed9e245db set baseline so Arnold can send pull request 2018-08-15 10:45:03 -04:00
Brian Kernighan 87b94932e6 initial commit for github 2012-12-22 10:35:39 -05:00