Commit Graph

210 Commits

Author SHA1 Message Date
Martijn Dekker
0619d5d537 repeat(): add FATAL calls for errors that should be impossible 2019-02-21 22:38:16 +01:00
Elliott Hughes
785d10884a Add .gitignore. 2019-01-29 17:27:07 -08:00
Elliott Hughes
cc165f4be9 maketab: support build systems with read-only source.
If your generated files are considered outputs that live elsewhere, you
need a way to tell maketab where ytab.h actually is.

Specifically, I'm trying to avoid checking in generated files in
Android's AOSP tree's copy of one-true-awk.
2019-01-29 17:20:00 -08:00
Leonardo Taccari
031aac816d
Merge branch 'master' into cc_func-avoid-undefined-behaviour 2019-01-28 17:34:58 +01:00
Arnold D. Robbins
f25e845cf7 Update version string in main.c. 2019-01-26 21:55:03 +02:00
Arnold D. Robbins
778d21f73b Simplify getline-numeric input and results. 2019-01-26 20:50:31 +02:00
Arnold D. Robbins
9206c643e8 Update FIXES. 2019-01-25 13:02:19 +02:00
Arnold D. Robbins
9dbd1f1de3 Make getline POSIX compliant w.r.t. numeric strings. 2019-01-25 12:56:06 +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
onetrueawk
c3c7c1370e
Merge pull request #27 from junghans/fix_parallel_build
fixed parallel build
2019-01-21 14:21:43 -05:00
onetrueawk
bf2585c9fd
Merge pull request #20 from melloc/nf-self-assign
Fix issues with NF self-assignment and setting NF to negative values
2019-01-21 14:20:37 -05:00
onetrueawk
79f008e853
Merge branch 'master' into nf-self-assign 2019-01-21 14:20:28 -05:00
onetrueawk
c154c3cb82
Merge pull request #19 from melloc/split-fs-from-array
Fix calling split() with a third argument that lives in the target array
2019-01-21 14:19:24 -05:00
onetrueawk
5a8a060bc3
Merge branch 'master' into split-fs-from-array 2019-01-21 14:19:07 -05:00
onetrueawk
0fd6135c23
Merge pull request #17 from melloc/subsep
Fix issues with numeric separator values
2019-01-21 14:18:07 -05:00
onetrueawk
10da937340
Merge branch 'master' into subsep 2019-01-21 14:17:57 -05:00
onetrueawk
905d260104
Merge pull request #16 from melloc/assign-expr
Fix issues with assigning during concatenation
2019-01-21 14:17:19 -05:00
onetrueawk
1d836ff681
Merge branch 'master' into assign-expr 2019-01-21 14:17:03 -05:00
onetrueawk
f70e36869e
Merge pull request #24 from melloc/fields-init
Fix initial "fields" buffer size
2019-01-21 14:12:05 -05:00
onetrueawk
55d20ec4e1
Merge pull request #23 from melloc/cntrl-class
Fix regular expressions containing [[:cntrl:]]
2019-01-21 14:11:21 -05:00
onetrueawk
d3d7d3d82d
Merge pull request #21 from melloc/end-of-args
Flags that begin with "--" should not be treated as end of args
2019-01-21 14:10:23 -05:00
onetrueawk
4f4701e090
Merge branch 'master' into nf-self-assign 2019-01-21 14:09:21 -05:00
onetrueawk
8dfde739e9
Merge branch 'master' into split-fs-from-array 2019-01-21 14:08:25 -05:00
onetrueawk
294f4c0db5
Merge pull request #18 from melloc/error-reporting
Improve error reporting messages
2019-01-21 14:06:28 -05:00
onetrueawk
11c1fc61d5
Merge branch 'master' into subsep 2019-01-21 14:05:24 -05:00
onetrueawk
52ef99e310
Merge pull request #15 from melloc/fmt-overflow
Protect against overflowing during OFMT/CONVFMT conversions
2019-01-21 14:03:38 -05:00
onetrueawk
611f775d8d
Merge branch 'master' into fmt-overflow 2019-01-21 14:02:18 -05:00
onetrueawk
3222d96844
Merge branch 'master' into assign-expr 2019-01-21 14:00:32 -05:00
onetrueawk
40b9214d2a
Merge pull request #14 from melloc/missing-precision
Check for format character precision argument before using it
2019-01-21 13:46:44 -05:00
onetrueawk
c3e17cc1c7
Merge pull request #13 from arnoldrobbins/master
Fix REGRESS so all tests run on Mac OS X.
2019-01-21 13:41:41 -05:00
Christoph Junghans
e4bb3bcbf0 fixed parallel build
Signed-off-by: Christoph Junghans <junghans@gentoo.org>
2018-12-30 09:04:34 -07:00
Cody Peter Mello
7580235939 Fix initial "fields" buffer size 2018-11-12 10:34:19 -08:00
Cody Peter Mello
a6392ef31c Fix regular expressions containing [[:cntrl:]] 2018-11-12 10:25:44 -08:00
Brian Kernighan
e8c280034f fix maketab non-bug 2018-10-25 13:28:54 -04: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
Cody Peter Mello
179536a516 Print an error message for negative NF values 2018-09-25 21:19:49 -07:00
Cody Peter Mello
6315525dbe Rebuild fields when NF is assigned to itself 2018-09-23 17:59:52 -07:00
Cody Peter Mello
52566c0aa4 Handle numeric FS, RS, OFS, and ORS values 2018-09-23 17:35:45 -07:00
Cody Peter Mello
6fe0a049bb Improve error reporting messages 2018-09-21 11:16:27 -07:00
Cody Peter Mello
d45db5e9d8 Fix calling split() with a third argument that lives in the target array 2018-09-18 15:20:44 -07:00
Cody Peter Mello
97a4b7ed21 Fix issues with numeric SUBSEP and large SUBSEP values 2018-09-17 11:59:04 -07:00
Cody Peter Mello
e26237434f Fix issues with assigning during concatenation 2018-09-15 01:43:21 -07:00
Cody Peter Mello
e059b3b197 Protect against overflowing during OFMT/CONVFMT conversions 2018-09-14 19:56:34 -07:00
Cody Peter Mello
6cf37e9d15 Check for format character precision argument before using it 2018-09-14 17:34:17 -07:00
Arnold D. Robbins
40c6916307 Fix REGRESS so all tests run on Mac OS X. 2018-08-29 21:18:21 +03:00
Leonardo Taccari
05014f5b9e avoid undefined behaviour when using ctype(3) functions in relex()
Because NCHARS is (256+3) cc->cc_func(i) was called with 256, 257
and 258 as argument leading to possible undefined behaviour (at
least on NetBSD with non-C locale (e.g. `en_US.UTF-8') this led to
only honoring one `[:...:]' character class in bracket expressions).

Fix #11
2018-08-29 18:06:33 +02:00
onetrueawk
2dc7e5ff1a
Merge pull request #9 from atsampson/master
makefile fixes: allow parallel make and work with pmake
2018-08-28 16:05:48 -04:00
Adam Sampson
9a4aa89176 Fix ytab.[ch] dependencies to allow parallel make.
The old ytab.o rule produced ytab.c and ytab.h too, but this wasn't
visible as dependencies, so make -j would fail. Make this explicit, and
use the implicit .c.o rule rather than writing out the $(CC) command.
2018-08-27 20:28:29 +01:00
Adam Sampson
837b8da3a5 Fix comment syntax for pmake.
GNU make is happy with leading tabs before a comment, but pmake says
"Unassociated shell command".
2018-08-27 20:27:34 +01:00
Brian Kernighan
1d9d86418a forgot to update version string 2018-08-27 08:58:33 -04:00