aboutsummaryrefslogtreecommitdiff
path: root/bugs-fixed
diff options
context:
space:
mode:
authorCody Peter Mello <melloc@writev.io>2018-09-25 21:19:49 -0700
committerCody Peter Mello <melloc@writev.io>2018-09-25 21:19:49 -0700
commit179536a5160006db2bd59772a96501f469bb6029 (patch)
tree1079d2b8f923573942f1d0074efb4907fe63868f /bugs-fixed
parent6315525dbef08bac66b6369f7d6952b67b5adcba (diff)
downloadone-true-awk-179536a5160006db2bd59772a96501f469bb6029.tar.gz
Print an error message for negative NF values
Diffstat (limited to 'bugs-fixed')
-rw-r--r--bugs-fixed/README2
-rw-r--r--bugs-fixed/negative-nf.awk1
-rw-r--r--bugs-fixed/negative-nf.ok2
3 files changed, 5 insertions, 0 deletions
diff --git a/bugs-fixed/README b/bugs-fixed/README
index 29c845f..dda3b2a 100644
--- a/bugs-fixed/README
+++ b/bugs-fixed/README
@@ -25,3 +25,5 @@ and also if CONVFMT changed.
Instead, it should convert the value to numeric and give that value.
X. nf-self-assign: "NF = NF" wouldn't force the record to be rebuilt.
+
+X. negative-nf: Setting NF to a negative value caused a segmentation fault.
diff --git a/bugs-fixed/negative-nf.awk b/bugs-fixed/negative-nf.awk
new file mode 100644
index 0000000..6caeee4
--- /dev/null
+++ b/bugs-fixed/negative-nf.awk
@@ -0,0 +1 @@
+BEGIN { NF = -5; }
diff --git a/bugs-fixed/negative-nf.ok b/bugs-fixed/negative-nf.ok
new file mode 100644
index 0000000..71c8604
--- /dev/null
+++ b/bugs-fixed/negative-nf.ok
@@ -0,0 +1,2 @@
+./a.out: cannot set NF to a negative value
+ source line number 1