aboutsummaryrefslogtreecommitdiffstats
path: root/test/rsgetline.awk
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2014-09-21 15:49:47 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2014-09-21 15:49:47 -0400
commitb4d06df669e1eaf6c98cacb5c5f299bb5324e804 (patch)
tree50fb039c2cf280921e7650230cb42b0669e17f0b /test/rsgetline.awk
parent94e3f93395de538d73826e128281a3ea9591a5a9 (diff)
parent8b4e8f702df30b2b2238158504de5d8eb436958d (diff)
downloadegawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.tar.gz
egawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.tar.bz2
egawk-b4d06df669e1eaf6c98cacb5c5f299bb5324e804.zip
Merge 'master' into select
Diffstat (limited to 'test/rsgetline.awk')
-rw-r--r--test/rsgetline.awk23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/rsgetline.awk b/test/rsgetline.awk
new file mode 100644
index 00000000..fa327fcf
--- /dev/null
+++ b/test/rsgetline.awk
@@ -0,0 +1,23 @@
+# Date: Sun, 4 May 2014 18:09:01 +0200
+# From: Davide Brini <dave_br@gmx.com>
+# To: bug-gawk@gnu.org
+# Subject: Re: [bug-gawk] Computed regex and getline bug / issue
+#
+# I have been able to reduce the behavior to these simple test cases, which
+# (unless I'm missing something obvious) should behave identically but don't:
+#
+# $ printf '1,2,' | gawk 'BEGIN{RS="[,]+"}{print; a = getline; print "-"a"-"; print}'
+# 1
+# -0-
+# 1
+
+BEGIN {
+ RS = "[,]+"
+}
+
+{
+ printf "[%s] [%s]\n", $0, RT
+ a = getline
+ print "-"a"-"
+ printf "[%s] [%s]\n", $0, RT
+}