Hello community,
here is the log from the commit of package gawk for openSUSE:Factory
checked in at Wed Sep 28 14:07:36 CEST 2011.
--------
--- gawk/gawk.changes 2011-08-10 06:03:06.000000000 +0200
+++ /mounts/work_src_done/STABLE/gawk/gawk.changes 2011-09-27 13:33:31.000000000 +0200
@@ -1,0 +2,6 @@
+Tue Sep 27 11:31:28 UTC 2011 - idonmez@suse.com
+
+- Revert sub/gsub behavior to that of gawk 3.x. Upstream commit
+ 16de770359370224129f23df745178efe518c02c
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
gawk-revert-gsub-gawk3.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gawk.spec ++++++
--- /var/tmp/diff_new_pack.wUKIgY/_old 2011-09-28 14:07:32.000000000 +0200
+++ /var/tmp/diff_new_pack.wUKIgY/_new 2011-09-28 14:07:32.000000000 +0200
@@ -29,7 +29,8 @@
Release: 1
Summary: GNU awk
Source: gawk-%{version}.tar.bz2
-Patch: gawk-3.1.8.diff
+Patch1: gawk-3.1.8.diff
+Patch2: gawk-revert-gsub-gawk3.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -50,7 +51,9 @@
%prep
%setup -q
-%patch
+%patch1
+%patch2 -p1
+
rm -f regex.[ch]
chmod -x COPYING
# force rebuild with non-broken makeinfo
++++++ gawk-revert-gsub-gawk3.patch ++++++
commit 16de770359370224129f23df745178efe518c02c
Author: Arnold D. Robbins
Date: Thu Jul 28 22:12:48 2011 +0300
Revert sub/gsub behavior to that of gawk 3.x.
diff --git a/builtin.c b/builtin.c
index 8685d29..4d87592 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2546,13 +2546,30 @@ set_how_many:
repllen--;
scan++;
}
- } else {
+ } else if (do_posix) {
/* \& --> &, \\ --> \ */
if (scan[1] == '&' || scan[1] == '\\') {
repllen--;
scan++;
} /* else
leave alone, it goes into the output */
+ } else {
+ /* gawk default behavior since 1996 */
+ if (strncmp(scan, "\\\\\\&", 4) == 0) {
+ /* \\\& --> \& */
+ repllen -= 2;
+ scan += 3;
+ } else if (strncmp(scan, "\\\\&", 3) == 0) {
+ /* \\& --> \<string> */
+ ampersands++;
+ repllen--;
+ scan += 2;
+ } else if (scan[1] == '&') {
+ /* \& --> & */
+ repllen--;
+ scan++;
+ } /* else
+ leave alone, it goes into the output */
}
}
}
@@ -2630,11 +2647,30 @@ set_how_many:
scan++;
} else /* \q for any q --> q */
*bp++ = *++scan;
- } else {
+ } else if (do_posix) {
/* \& --> &, \\ --> \ */
if (scan[1] == '&' || scan[1] == '\\')
scan++;
*bp++ = *scan;
+ } else {
+ /* gawk default behavior since 1996 */
+ if (strncmp(scan, "\\\\\\&", 4) == 0) {
+ /* \\\& --> \& */
+ *bp++ = '\\';
+ *bp++ = '&';
+ scan += 3;
+ } else if (strncmp(scan, "\\\\&", 3) == 0) {
+ /* \\& --> \<string> */
+ *bp++ = '\\';
+ for (cp = matchstart; cp < matchend; cp++)
+ *bp++ = *cp;
+ scan += 2;
+ } else if (scan[1] == '&') {
+ /* \& --> & */
+ *bp++ = '&';
+ scan++;
+ } else
+ *bp++ = *scan;
}
} else
*bp++ = *scan;
diff --git a/test/Makefile.am b/test/Makefile.am
index 82e0834..9780e79 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1376,9 +1376,14 @@ profile3:
@sed 1,2d < awkprof.out > _$@; rm awkprof.out
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+posix2008sub:
+ @echo $@
+ @$(AWK) --posix -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
next:
@echo $@
- @-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
+ @-AWK="$(AWKPROG)" $(srcdir)/$@.sh
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
exit:
diff --git a/test/backgsub.ok b/test/backgsub.ok
index 2d3f17f..e2e265f 100644
--- a/test/backgsub.ok
+++ b/test/backgsub.ok
@@ -1 +1 @@
-\x\y\z
+\\x\\y\\z
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org