|
Packit |
575503 |
# Date: Sun, 4 May 2014 18:09:01 +0200
|
|
Packit |
575503 |
# From: Davide Brini <dave_br@gmx.com>
|
|
Packit |
575503 |
# To: bug-gawk@gnu.org
|
|
Packit |
575503 |
# Subject: Re: [bug-gawk] Computed regex and getline bug / issue
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# I have been able to reduce the behavior to these simple test cases, which
|
|
Packit |
575503 |
# (unless I'm missing something obvious) should behave identically but don't:
|
|
Packit |
575503 |
#
|
|
Packit |
575503 |
# $ printf '1,2,' | gawk 'BEGIN{RS="[,]+"}{print; a = getline; print "-"a"-"; print}'
|
|
Packit |
575503 |
# 1
|
|
Packit |
575503 |
# -0-
|
|
Packit |
575503 |
# 1
|
|
Packit |
575503 |
|
|
Packit |
575503 |
BEGIN {
|
|
Packit |
575503 |
RS = "[,]+"
|
|
Packit |
575503 |
}
|
|
Packit |
575503 |
|
|
Packit |
575503 |
{
|
|
Packit |
575503 |
printf "[%s] [%s]\n", $0, RT
|
|
Packit |
575503 |
a = getline
|
|
Packit |
575503 |
print "-"a"-"
|
|
Packit |
575503 |
printf "[%s] [%s]\n", $0, RT
|
|
Packit |
575503 |
}
|