SHA256
3
0
forked from pool/gawk
OBS User unknown 2006-12-18 23:16:01 +00:00 committed by Git OBS Bridge
commit c3843e8035
15 changed files with 1653 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

309
dev-fd.diff Normal file
View File

@ -0,0 +1,309 @@
From nobody Tue Jul 4 10:54:31 2006
From: Aharon Robbins <arnold@skeeve.com>
Subject: Re: /dev/fd/n bug in gawk 3.1.5
To: aschorr@telemetry-investments.com
Cc: Juergen.Kahrs@vr-web.de, bug-gawk@gnu.org, spcecdt@armory.com
Date: Tue, 04 Jul 2006 07:40:10 +0300
> Date: Mon, 03 Jul 2006 16:54:19 -0400
> From: "Andrew J. Schorr" <aschorr@telemetry-investments.com>
> Subject: Re: /dev/fd/n bug in gawk 3.1.5
> To: Aharon Robbins <arnold@skeeve.com>
>
> Hi,
>
> Note that the pid test was failing silently: "make check" was
> reporting "ALL TESTS PASSED" even though gawk was SEGV'ing
> in the pid test.
I noticed this on RHEL 4 system at work where the test failed
noisily. I'm guessing a difference in versions of bash...
> Attached is a patch to the pid test
> that fixes this problem (i.e. the test will now fail noisily).
> The problem was that the SEGV was aborting the script
> prematurely, and leaving a zero-length output file, which was
> precisely correct. The fix was to make sure that test/pid.awk
> produces some output. That way we get a comparison failure
> if the output file is empty.
Actually, the correct fix is to keep gawk from SEGV-ing in the
first place. Below is full diff of io.c relative to 3.1.5.
I will probably incorporate your changes also as extra insurance.
Thanks,
Arnold
-----------------------------------------------------
Mon Jul 3 00:27:59 2006 Arnold D. Robbins <arnold@skeeve.com>
* io.c (INTERNAL_HANDLE): New constant for use by `iop_alloc'
when allocating an internal IOBUF.
(pidopen, useropen): Use it.
(iop_alloc): Add check for it and just return iop.
Sun Jun 18 22:27:25 2006 Arnold D. Robbins <arnold@skeeve.com>
Repair internal names like /dev/user, /dev/pid, as well as /dev/fd/N,
which have been broken for a long time but noone noticed.
* io.c (is_internal): new macro to check for internal file like `/dev/user'.
(spec_setup): Reduce to two parameters, allocate logic is always true.
Add IOP_NO_FREE to flag.
(pidopen, useropen): Return `IOBUF *' instead of int. Fix
logic to test if `iop' parameter is NULL and if so to allocate it.
(specfdopen,): Return `IOBUF *' instead of int. Fix
logic to test if `iop' parameter is NULL and if so to allocate it.
Don't set IOP_NO_FREE in flag.
(iop_open): Remove `IOBUF iob' field from `struct internal' and its use
and the use of `spec_setup' from the code here. Change the check in the
call to the open function to look for NULL.
(get_a_record): Use `is_internal' in initial check for filling the
buffer to not try to call `read' on internal files. If true, set
the IOP_AT_EOF in the flag and return EOF.
Fri Aug 12 13:10:33 2005 Arnold D. Robbins <arnold@skeeve.com>
* io.c (iop_alloc): Only free `iop' if it was malloc'ed in
the first place.
--- ../gawk-3.1.5/io.c 2005-07-26 21:07:43.000000000 +0300
+++ io.c 2006-07-03 00:27:51.000000000 +0300
@@ -103,6 +103,9 @@
typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type;
+/* For internal files, /dev/pid, etc. */
+#define INTERNAL_HANDLE (-42)
+
/* Several macros make the code a bit clearer: */
/* */
/* */
@@ -110,6 +113,7 @@
#define at_eof(iop) ((iop->flag & IOP_AT_EOF) != 0)
#define has_no_data(iop) (iop->dataend == NULL)
#define no_data_left(iop) (iop->off >= iop->dataend)
+#define is_internal(iop) ((iop->flag & IOP_IS_INTERNAL) != 0)
/* The key point to the design is to split out the code that searches through */
/* a buffer looking for the record and the terminator into separate routines, */
/* with a higher-level routine doing the reading of data and buffer management. */
@@ -163,10 +167,10 @@
static int gawk_pclose P((struct redirect *rp));
static int do_pathopen P((const char *file));
static int str2mode P((const char *mode));
-static void spec_setup P((IOBUF *iop, int len, int allocate));
-static int specfdopen P((IOBUF *iop, const char *name, const char *mode));
-static int pidopen P((IOBUF *iop, const char *name, const char *mode));
-static int useropen P((IOBUF *iop, const char *name, const char *mode));
+static void spec_setup P((IOBUF *iop, int len));
+static IOBUF *specfdopen P((IOBUF *iop, const char *name, const char *mode));
+static IOBUF *pidopen P((IOBUF *iop, const char *name, const char *mode));
+static IOBUF *useropen P((IOBUF *iop, const char *name, const char *mode));
static int two_way_open P((const char *str, struct redirect *rp));
static int pty_vs_pipe P((const char *command));
@@ -1422,30 +1426,24 @@
/* spec_setup --- setup an IOBUF for a special internal file */
static void
-spec_setup(IOBUF *iop, int len, int allocate)
+spec_setup(IOBUF *iop, int len)
{
char *cp;
- if (allocate) {
- emalloc(cp, char *, len+2, "spec_setup");
- iop->buf = cp;
- } else {
- len = strlen(iop->buf);
- iop->buf[len++] = '\n'; /* get_a_record clobbered it */
- iop->buf[len] = '\0'; /* just in case */
- }
+ emalloc(cp, char *, len+2, "spec_setup");
+ iop->buf = cp;
iop->off = iop->buf;
iop->count = 0;
iop->size = len;
iop->end = iop->buf + len;
iop->dataend = iop->end;
iop->fd = -1;
- iop->flag = IOP_IS_INTERNAL | IOP_AT_START;
+ iop->flag = IOP_IS_INTERNAL | IOP_AT_START | IOP_NO_FREE;
}
/* specfdopen --- open an fd special file */
-static int
+static IOBUF *
specfdopen(IOBUF *iop, const char *name, const char *mode)
{
int fd;
@@ -1453,17 +1451,14 @@
fd = devopen(name, mode);
if (fd == INVALID_HANDLE)
- return INVALID_HANDLE;
- tp = iop_alloc(fd, name, NULL);
+ return NULL;
+ tp = iop_alloc(fd, name, iop);
if (tp == NULL) {
/* don't leak fd's */
close(fd);
- return INVALID_HANDLE;
+ return NULL;
}
- *iop = *tp;
- iop->flag |= IOP_NO_FREE;
- free(tp);
- return 0;
+ return tp;
}
#ifdef GETPGRP_VOID
@@ -1474,7 +1469,7 @@
/* pidopen --- "open" /dev/pid, /dev/ppid, and /dev/pgrpid */
-static int
+static IOBUF *
pidopen(IOBUF *iop, const char *name, const char *mode ATTRIBUTE_UNUSED)
{
char tbuf[BUFSIZ];
@@ -1483,6 +1478,12 @@
warning(_("use `PROCINFO[\"%s\"]' instead of `%s'"), cp, name);
+ if (iop == NULL) {
+ iop = iop_alloc(INTERNAL_HANDLE, name, iop);
+ if (iop == NULL)
+ return NULL;
+ }
+
if (name[6] == 'g')
sprintf(tbuf, "%d\n", (int) getpgrp(getpgrp_arg()));
else if (name[6] == 'i')
@@ -1490,9 +1491,9 @@
else
sprintf(tbuf, "%d\n", (int) getppid());
i = strlen(tbuf);
- spec_setup(iop, i, TRUE);
+ spec_setup(iop, i);
strcpy(iop->buf, tbuf);
- return 0;
+ return iop;
}
/* useropen --- "open" /dev/user */
@@ -1507,7 +1508,7 @@
* supplementary group set.
*/
-static int
+static IOBUF *
useropen(IOBUF *iop, const char *name ATTRIBUTE_UNUSED, const char *mode ATTRIBUTE_UNUSED)
{
char tbuf[BUFSIZ], *cp;
@@ -1515,6 +1516,12 @@
warning(_("use `PROCINFO[...]' instead of `/dev/user'"));
+ if (iop == NULL) {
+ iop = iop_alloc(INTERNAL_HANDLE, name, iop);
+ if (iop == NULL)
+ return NULL;
+ }
+
sprintf(tbuf, "%d %d %d %d", (int) getuid(), (int) geteuid(), (int) getgid(), (int) getegid());
cp = tbuf + strlen(tbuf);
@@ -1529,9 +1536,9 @@
*cp++ = '\0';
i = strlen(tbuf);
- spec_setup(iop, i, TRUE);
+ spec_setup(iop, i);
strcpy(iop->buf, tbuf);
- return 0;
+ return iop;
}
/* iop_open --- handle special and regular files for input */
@@ -1544,8 +1551,7 @@
static struct internal {
const char *name;
int compare;
- int (*fp) P((IOBUF *, const char *, const char *));
- IOBUF iob;
+ IOBUF *(*fp) P((IOBUF *, const char *, const char *));
} table[] = {
{ "/dev/fd/", 8, specfdopen },
{ "/dev/stdin", 10, specfdopen },
@@ -1570,12 +1576,7 @@
for (i = 0; i < devcount; i++) {
if (STREQN(name, table[i].name, table[i].compare)) {
- iop = & table[i].iob;
-
- if (iop->buf != NULL) {
- spec_setup(iop, 0, FALSE);
- return iop;
- } else if ((*table[i].fp)(iop, name, mode) == 0)
+ if ((iop = (*table[i].fp)(iop, name, mode)) != NULL)
return iop;
else {
warning(_("could not open `%s', mode `%s'"),
@@ -2480,9 +2481,12 @@
{
struct stat sbuf;
struct open_hook *oh;
+ int iop_malloced = FALSE;
- if (iop == NULL)
+ if (iop == NULL) {
emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
+ iop_malloced = TRUE;
+ }
memset(iop, '\0', sizeof(IOBUF));
iop->flag = 0;
iop->fd = fd;
@@ -2494,8 +2498,12 @@
break;
}
+ if (iop->fd == INTERNAL_HANDLE)
+ return iop;
+
if (iop->fd == INVALID_HANDLE) {
- free(iop);
+ if (iop_malloced)
+ free(iop);
return NULL;
}
if (isatty(iop->fd))
@@ -2503,7 +2511,7 @@
iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
iop->sbuf = sbuf;
if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
- lintwarn(_("data file `%s' is empty"), name);
+ lintwarn(_("data file `%s' is empty"), name);
errno = 0;
iop->count = iop->scanoff = 0;
emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");
@@ -2906,6 +2914,10 @@
/* <fill initial buffer>= */
if (has_no_data(iop) || no_data_left(iop)) {
+ if (is_internal(iop)) {
+ iop->flag |= IOP_AT_EOF;
+ return EOF;
+ }
iop->count = read(iop->fd, iop->buf, iop->readsize);
if (iop->count == 0) {
iop->flag |= IOP_AT_EOF;
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils

18
dfa-mbcset.diff Normal file
View File

@ -0,0 +1,18 @@
--- dfa.c
+++ dfa.c
@@ -1373,7 +1373,14 @@
int i;
for (i = 0; i < ntokens; ++i)
- addtok(dfa->tokens[tindex + i]);
+ {
+ addtok(dfa->tokens[tindex + i]);
+#ifdef MBS_SUPPORT
+ /* Update index into multibyte csets. */
+ if (MB_CUR_MAX > 1 && dfa->tokens[tindex + i] == MBCSET)
+ dfa->multibyte_prop[dfa->tindex - 1] = dfa->multibyte_prop[tindex + i];
+#endif
+ }
}
static void

47
embedded-nul.diff Normal file
View File

@ -0,0 +1,47 @@
From nobody Wed Nov 30 23:49:26 2005
From: Paul Eggert <eggert@CS.UCLA.EDU>
Subject: Re: gawk: length return incorrect value when MB_CUR_MAX > 1
To: Hirofumi Saito <hi_saito@yk.rim.or.jp>
Cc: bug-gawk@gnu.org, KIMURA Koichi <kimura.koichi@canon.co.jp>
Date: Wed, 30 Nov 2005 13:39:56 -0800
Hirofumi Saito <hi_saito@yk.rim.or.jp> writes:
> And then, I tried to use gawk 3.1.5 which I build with sarge.
>
> $ LANG=ja_JP.utf8 gawk 'BEGIN {print length("abc\0def")}'
> 7
> $ LANG=ja_JP.eucJP gawk 'BEGIN {print length("abc\0def")}'
> 3
Very strange. I don't get this result with Debian sarge x86; instead,
I get 3 in both cases. And that is what I would expect to get, given
the source code. Perhaps your locales weren't all built? (Also, I
set LC_ALL rather than LANG; that's safer.)
> By the way, I patched Kimura's patch, then:
Yes, his patch should work.
Here's a slightly more-efficient patch:
--- node.c-bak 2005-07-26 11:07:43.000000000 -0700
+++ node.c 2005-11-30 13:33:44.000000000 -0800
@@ -749,9 +749,10 @@ str2wstr(NODE *n, size_t **ptr)
switch (count) {
case (size_t) -2:
case (size_t) -1:
- case 0:
goto done;
+ case 0:
+ count = 1;
default:
*wsp++ = wc;
src_count -= count;
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils

72
fieldwidths.diff Normal file
View File

@ -0,0 +1,72 @@
From nobody Fri Oct 7 13:31:33 2005
From: Aharon Robbins <arnold@skeeve.com>
Subject: Re: gawk 3.1.5 FIELDWIDTHS bug - 1 off
To: jeff93@silk.corp.fedex.com
Cc: bug-gnu-utils@gnu.org
Date: Fri, 07 Oct 2005 12:26:28 +0200
Greetings. Re this:
> Date: Fri, 30 Sep 2005 21:00:12 +0800 (SGT)
> From: Jeff Chua <jeff93@silk.corp.fedex.com>
> Subject: gawk 3.1.5 FIELDWIDTHS bug - 1 off
> To: Awk Bug <bug-gawk@gnu.org>
>
> echo "a b b" | awk 'BEGIN {FIELDWIDTHS = "1 1 1 "} {print NF}'
>
> 3.1.5 returns 2
> 3.1.4 returns 3
> 3.1.3 returns 3
>
> Is this a new feature or a bug?
>
> Thanks,
> Jeff.
This is a bug. I'm adding a test to the test suite for it.
Here is the fix.
Thanks for reporting it.
Arnold
-----------------------------------------------------------------------
Fri Oct 7 13:23:29 2005 Arnold D. Robbins <arnold@skeeve.com>
* field.c (set_FIELDWIDTHS): Fix off-by-one error in assignment
of sentinel value at end of FIELDWIDTHS array.
--- ../gawk-3.1.5/field.c 2005-05-11 18:28:15.000000000 +0300
+++ field.c 2005-10-07 12:22:05.566125547 +0200
@@ -916,7 +916,7 @@
parse_field = fw_parse_field;
scan = force_string(FIELDWIDTHS_node->var_value)->stptr;
- end = scan + 1;
+
if (FIELDWIDTHS == NULL)
emalloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS");
FIELDWIDTHS[0] = 0;
@@ -941,7 +941,7 @@
errno = 0;
tmp = strtoul(scan, &end, 10);
if (errno != 0
- || !(*end == '\0' || is_blank(*end))
+ || (*end != '\0' && ! is_blank(*end))
|| !(0 < tmp && tmp <= INT_MAX))
fatal(_("invalid FIELDWIDTHS value, near `%s'"),
scan);
@@ -954,7 +954,7 @@
if (*scan == '\0')
break;
}
- FIELDWIDTHS[i] = -1;
+ FIELDWIDTHS[i+1] = -1;
update_PROCINFO("FS", "FIELDWIDTHS");
}
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils

57
gawk-3.1.5.diff Normal file
View File

@ -0,0 +1,57 @@
--- Makefile.am
+++ Makefile.am
@@ -101,11 +101,7 @@
msg.c \
node.c \
protos.h \
- random.c \
- random.h \
re.c \
- regex.c \
- regex.h \
replace.c \
version.c
--- builtin.c
+++ builtin.c
@@ -37,7 +37,6 @@
# include <stdint.h>
#endif
#include <math.h>
-#include "random.h"
#ifndef CHAR_BIT
# define CHAR_BIT 8
@@ -62,12 +61,6 @@
#define SIZE_MAX ((size_t) -1)
#endif
-/* can declare these, since we always use the random shipped with gawk */
-extern char *initstate P((unsigned long seed, char *state, long n));
-extern char *setstate P((char *state));
-extern long random P((void));
-extern void srandom P((unsigned long seed));
-
extern NODE **fields_arr;
extern int output_is_tty;
--- doc/gawk.texi
+++ doc/gawk.texi
@@ -1397,7 +1397,7 @@
Chuck Toporek.
@cindex Berry, Karl
-@cindex Chassell, Robert J.@:
+@cindex Chassell, Robert J.
@c @cindex Texinfo
Robert J.@: Chassell provided much valuable advice on
the use of Texinfo.
@@ -23495,7 +23495,7 @@
GNU Automake and @code{gettext}.
@item
-@cindex Broder, Alan J.@:
+@cindex Broder, Alan J.
Alan J.@: Broder
provided the initial version of the @code{asort} function
as well as the code for the new optional third argument to the @code{match} function.

3
gawk-3.1.5.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:35ca06720396e25e2f4fd0ebf063c5ed55d4c0a93096960316f9f62e72a1f40d
size 1756783

460
gawk.changes Normal file
View File

@ -0,0 +1,460 @@
-------------------------------------------------------------------
Fri Sep 1 13:02:34 CEST 2006 - schwab@suse.de
- Drop doc subpackage.
-------------------------------------------------------------------
Mon Jul 24 10:35:21 CEST 2006 - schwab@suse.de
- Add multibyte patch.
-------------------------------------------------------------------
Wed Jul 5 10:51:33 CEST 2006 - schwab@suse.de
- Fix conversion error.
-------------------------------------------------------------------
Tue Jul 4 10:56:26 CEST 2006 - schwab@suse.de
- New version of last change.
-------------------------------------------------------------------
Sun Jun 18 16:13:32 CEST 2006 - schwab@suse.de
- Properly handle /dev/fd.
-------------------------------------------------------------------
Sat Mar 4 23:03:26 CET 2006 - schwab@suse.de
- Add two wide string bug fixes.
-------------------------------------------------------------------
Thu Feb 9 11:39:04 CET 2006 - schwab@suse.de
- Fix dfa generation of interval expressions [#148453].
-------------------------------------------------------------------
Thu Jan 26 18:51:30 CET 2006 - schwab@suse.de
- Use %jobs.
-------------------------------------------------------------------
Wed Jan 25 21:30:13 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Wed Nov 30 23:59:09 CET 2005 - schwab@suse.de
- Fix length on strings with embedded NUL.
-------------------------------------------------------------------
Fri Oct 7 14:18:37 CEST 2005 - schwab@suse.de
- Fix off-by-one when processing FIELDWIDTHS.
-------------------------------------------------------------------
Fri Sep 2 19:05:49 CEST 2005 - schwab@suse.de
- Update to gaw 3.1.5.
-------------------------------------------------------------------
Wed May 25 14:10:25 CEST 2005 - schwab@suse.de
- Update flonum parsing patch.
-------------------------------------------------------------------
Sat Feb 12 00:25:51 CET 2005 - schwab@suse.de
- Add libpng to neededforbuild.
-------------------------------------------------------------------
Wed Feb 2 18:47:07 CET 2005 - schwab@suse.de
- Ignore exit code from pipes.
-------------------------------------------------------------------
Tue Sep 28 23:22:50 CEST 2004 - schwab@suse.de
- Fix parsing of floating point number that start with more than one
zero.
-------------------------------------------------------------------
Sun Sep 19 23:49:11 CEST 2004 - schwab@suse.de
- Disable invalid shortcut in dfaexec [#44512].
- Fix reading past EOF.
-------------------------------------------------------------------
Mon Aug 23 22:35:32 CEST 2004 - schwab@suse.de
- Update to gawk 3.1.4.
-------------------------------------------------------------------
Fri Aug 6 16:57:35 CEST 2004 - schwab@suse.de
- Use random from glibc [#43568].
-------------------------------------------------------------------
Thu Aug 5 15:45:04 CEST 2004 - schwab@suse.de
- Update to gawk 3.1.3l.
-------------------------------------------------------------------
Thu Jul 22 15:20:23 CEST 2004 - schwab@suse.de
- Fix int/long mismatch.
-------------------------------------------------------------------
Mon Apr 5 14:27:35 CEST 2004 - schwab@suse.de
- Disable non-POSIX strtod replacement [#38332].
-------------------------------------------------------------------
Fri Mar 12 14:40:57 CET 2004 - schwab@suse.de
- Fix doc bug.
-------------------------------------------------------------------
Sat Jan 10 12:57:19 CET 2004 - adrian@suse.de
- do not strip during install, let rpm do it
-------------------------------------------------------------------
Wed Jul 9 15:21:10 CEST 2003 - schwab@suse.de
- Update to gawk 3.1.3.
-------------------------------------------------------------------
Thu Jun 5 13:33:33 CEST 2003 - jh@suse.de
- Enable profile feedback
-------------------------------------------------------------------
Tue May 13 11:59:43 CEST 2003 - schwab@suse.de
- Add %defattr.
- Fix file list.
-------------------------------------------------------------------
Thu Apr 24 12:20:23 CEST 2003 - ro@suse.de
- fix install_info --delete call and move from preun to postun
-------------------------------------------------------------------
Mon Apr 7 13:11:30 CEST 2003 - schwab@suse.de
- Only delete info entries when removing last version.
-------------------------------------------------------------------
Thu Mar 27 16:56:42 CET 2003 - schwab@suse.de
- Update to gawk 3.1.2.
-------------------------------------------------------------------
Fri Feb 7 13:49:41 CET 2003 - schwab@suse.de
- Fix spec file.
-------------------------------------------------------------------
Thu Feb 6 17:48:28 CET 2003 - schwab@suse.de
- Use %install_info.
-------------------------------------------------------------------
Mon Nov 18 12:04:42 CET 2002 - schwab@suse.de
- Add AM_GNU_GETTEXT_VERSION.
-------------------------------------------------------------------
Tue Sep 17 18:39:14 CEST 2002 - ro@suse.de
- removed bogus self-provides
-------------------------------------------------------------------
Mon Aug 5 17:25:58 CEST 2002 - schwab@suse.de
- Add fix for gsub.
-------------------------------------------------------------------
Mon Jul 29 11:43:21 CEST 2002 - schwab@suse.de
- Fix broken patch.
-------------------------------------------------------------------
Thu Jul 18 12:08:53 CEST 2002 - schwab@suse.de
- Add lint check for delete.
-------------------------------------------------------------------
Tue May 14 17:28:35 CEST 2002 - schwab@suse.de
- Add fix for memory leak in loops.
- Add fix for side effects in split().
-------------------------------------------------------------------
Fri May 10 13:54:47 CEST 2002 - schwab@suse.de
- Update to gawk-3.1.1 (bugfix release).
-------------------------------------------------------------------
Tue Apr 9 16:59:47 CEST 2002 - schwab@suse.de
- Fix default AWKPATH.
-------------------------------------------------------------------
Sat Mar 30 23:13:12 CET 2002 - schwab@suse.de
- Fix for new gettext.
-------------------------------------------------------------------
Sun Mar 17 17:37:30 CET 2002 - schwab@suse.de
- Fix buffer overflow.
-------------------------------------------------------------------
Mon Feb 18 14:35:45 CET 2002 - schwab@suse.de
- Workaround spurious limitation in regex matcher.
- Fix bogus assertion in strtonum.
-------------------------------------------------------------------
Mon Jan 28 18:21:22 CET 2002 - schwab@suse.de
- Add i18n patch.
-------------------------------------------------------------------
Fri Jan 11 17:09:51 CET 2002 - schwab@suse.de
- Two more patches from the author:
* Fix use of getgroups
* Fix grammer in for statement.
-------------------------------------------------------------------
Fri Nov 30 14:31:42 CET 2001 - schwab@suse.de
- Replace overrun patch with a better one.
- Fix provides.
-------------------------------------------------------------------
Mon Nov 26 15:17:59 CET 2001 - schwab@suse.de
- Use regex from libc again.
-------------------------------------------------------------------
Wed Nov 7 16:51:32 CET 2001 - schwab@suse.de
- Fix memory overrun.
-------------------------------------------------------------------
Mon Nov 5 23:32:06 CET 2001 - schwab@suse.de
- Fix lint checking and off-by-one error for printf.
-------------------------------------------------------------------
Fri Oct 5 16:08:45 CEST 2001 - schwab@suse.de
- Fix for memory corruption bug from author.
-------------------------------------------------------------------
Tue Sep 25 16:34:38 CEST 2001 - schwab@suse.de
- Don't set close-on-exec on standard fd (from author).
-------------------------------------------------------------------
Thu Aug 23 16:31:12 CEST 2001 - schwab@suse.de
- Fix for unary minus operator from author.
-------------------------------------------------------------------
Wed Aug 8 20:29:20 CEST 2001 - schwab@suse.de
- Fix for memory leak from author.
-------------------------------------------------------------------
Wed Jul 25 19:20:35 CEST 2001 - schwab@suse.de
- Fix for empty RS and and blank input from author.
-------------------------------------------------------------------
Mon Jul 16 20:25:15 CEST 2001 - schwab@suse.de
- Fix for index(foo, "") from author.
-------------------------------------------------------------------
Wed Jun 13 19:55:16 CEST 2001 - schwab@suse.de
- Include fix for allocation bug from author.
-------------------------------------------------------------------
Mon Jun 4 18:27:31 CEST 2001 - schwab@suse.de
- Update to 3.1.0.
-------------------------------------------------------------------
Sun May 13 21:23:29 CEST 2001 - schwab@suse.de
- Use included regex.c (#7953).
-------------------------------------------------------------------
Wed May 9 19:37:33 CEST 2001 - cstein@suse.de
- repacked sources with bzip2.
-------------------------------------------------------------------
Thu Apr 12 19:14:40 CEST 2001 - schwab@suse.de
- Add patch for \<\> from author.
-------------------------------------------------------------------
Tue Mar 20 14:10:02 CET 2001 - schwab@suse.de
- Add parser patch from author.
-------------------------------------------------------------------
Thu Mar 8 14:32:03 CET 2001 - schwab@suse.de
- Add two patches from author.
-------------------------------------------------------------------
Tue Oct 24 16:38:39 CEST 2000 - schwab@suse.de
- Rename subpackage gawkdoc to gawk-doc.
-------------------------------------------------------------------
Thu Sep 14 15:01:25 CEST 2000 - schwab@suse.de
- Add FIELDWIDTHS bug fix from arnold@skeeve.com.
-------------------------------------------------------------------
Tue Aug 8 13:20:49 CEST 2000 - schwab@suse.de
- Update to 3.0.6.
-------------------------------------------------------------------
Fri Jun 30 12:58:10 CEST 2000 - schwab@suse.de
- Fix handling of array indexes.
-------------------------------------------------------------------
Tue Jun 27 10:44:19 CEST 2000 - schwab@suse.de
- Update to 3.0.5.
-------------------------------------------------------------------
Tue May 9 16:17:20 CEST 2000 - schwab@suse.de
- Fix symlinks.
-------------------------------------------------------------------
Mon May 8 12:07:00 CEST 2000 - schwab@suse.de
- Switch to BuildRoot.
- Move /usr/bin/{,g}awk to /bin.
-------------------------------------------------------------------
Fri Apr 7 01:21:59 MEST 2000 - bk@suse.de
- added suse autoconf update macro
-------------------------------------------------------------------
Tue Apr 4 12:21:09 CEST 2000 - schwab@suse.de
- Fix IGNORECASE bug.
-------------------------------------------------------------------
Fri Mar 31 13:20:38 CEST 2000 - schwab@suse.de
- Include more docs.
-------------------------------------------------------------------
Tue Feb 15 17:53:02 CET 2000 - schwab@suse.de
- Fix parser bug.
-------------------------------------------------------------------
Tue Feb 15 15:29:21 CET 2000 - schwab@suse.de
- Update config{guess,sub} to latest version.
-------------------------------------------------------------------
Tue Jan 18 14:10:26 CET 2000 - schwab@suse.de
- /usr/{info,man} -> /usr/share/{info,man}
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
-------------------------------------------------------------------
Fri Aug 27 11:14:07 CEST 1999 - schwab@suse.de
- specfile cleanup
- run "make check"
- use regex from libc
-------------------------------------------------------------------
Mon Jul 19 11:32:32 MEST 1999 - florian@suse.de
- update to gawk 3.0.4
-------------------------------------------------------------------
Thu Dec 10 07:38:32 MET 1998 - florian@suse.de
- egcs miscompiles gawk, use gcc instead
-------------------------------------------------------------------
Fri Jul 17 14:53:55 MEST 1998 - werner@suse.de
- Use mktemp for igawk
-------------------------------------------------------------------
Wed May 13 17:21:23 MEST 1998 - ro@suse.de
- used dif from jurix-mirror (date Mar 7 1998)
- some of the patches from gnu.utils.bug are still buggy. applied some new
patches from the author Aharon Robbins to field.c.
-------------------------------------------------------------------
Mon Mar 2 16:45:10 MET 1998 - florian@suse.de
- use a complete new patchkit from various bug-reports
to gnu.utils.bug
-------------------------------------------------------------------
Wed Feb 4 17:53:53 MET 1998 - ro@suse.de
- build gawkdoc from same specfile
----------------------------------------------------------------------------
Thu Oct 9 19:08:47 MEST 1997 - florian@suse.de
- prepare for autobuild
----------------------------------------------------------------------------
Fri Jul 18 14:52:35 MEST 1997 - florian@suse.de
- add bug-fixes from gnu.utils.bug
----------------------------------------------------------------------------
Fri Jul 18 14:52:35 MEST 1997 - florian@suse.de
- add several patches from gnu.utils.bug
- gawk should work with c-news again
----------------------------------------------------------------------------
Tue May 20 14:10:37 MEST 1997 - florian@suse.de
- update to version 3.0.3
----------------------------------------------------------------------------
Sun Apr 13 23:04:29 MEST 1997 - florian@suse.de
- add bug-fixes from gnu.utils.bugs
- do not use /usr/libexec anymore
----------------------------------------------------------------------------
Wed Jan 22 22:24:11 CET 1997 - florian@suse.de
- update to version 3.0.2

312
gawk.spec Normal file
View File

@ -0,0 +1,312 @@
#
# spec file for package gawk (Version 3.1.5)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: gawk
URL: http://www.gnu.org/software/gawk/
License: GPL, Other License(s), see package
Group: Productivity/Text/Utilities
Provides: awk
Autoreqprov: on
PreReq: %{install_info_prereq}
Version: 3.1.5
Release: 24
Summary: GNU awk
Source: gawk-%{version}.tar.bz2
Patch: gawk-%{version}.diff
Patch1: multibyte.diff
Patch2: fieldwidths.diff
Patch3: embedded-nul.diff
Patch4: parallel-make.diff
Patch5: dfa-mbcset.diff
Patch8: sub-common.diff
Patch9: dev-fd.diff
Patch10: numeric-conversion.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
GNU awk is upwardly compatible with the System V Release 4 awk. It is
almost completely POSIX 1003.2 compliant.
Authors:
--------
David Trueman <david@cs.dal.ca>
Arnold Robbins <arnold@skeeve.com>
Michal Jaegermann <michal@gorte.phys.ualberta.ca>
Scott Deifik <scottd@amgen.com>
Darrel Hankerson <hankedr@mail.auburn.edu>
Kai Uwe Rommel <rommel@ars.de>
Pat Rankin <rankin@eql.caltech.edu>
%prep
%setup -q
%patch
%patch1
%patch2
%patch3
%patch4
%patch5
%patch8
%patch9
%patch10
rm -f regex.[ch]
%build
%{suse_update_config -f}
autoreconf --force --install
export CFLAGS=$RPM_OPT_FLAGS
./configure --prefix=/usr --libexecdir=%{_libdir} \
--mandir=%{_mandir} --infodir=%{_infodir}
%if %do_profiling
make %{?jobs:-j%jobs} CFLAGS="$CFLAGS %cflags_profile_generate"
make check
make clean
make %{?jobs:-j%jobs} CFLAGS="$CFLAGS %cflags_profile_feedback"
%else
make %{?jobs:-j%jobs}
%endif
make check
%install
make install DESTDIR=$RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/bin
mv -f $RPM_BUILD_ROOT/usr/bin/awk $RPM_BUILD_ROOT/usr/bin/gawk \
$RPM_BUILD_ROOT/bin
ln -sf ../../bin/awk ../../bin/gawk $RPM_BUILD_ROOT/usr/bin
ln -sf gawk.1 $RPM_BUILD_ROOT%{_mandir}/man1/awk.1
rm -f $RPM_BUILD_ROOT/usr/bin/*-%{version}
%clean
rm -rf $RPM_BUILD_ROOT
%post
%install_info --info-dir=%{_infodir} %{_infodir}/gawk.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/gawkinet.info.gz
%postun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gawk.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/gawkinet.info.gz
%files
%defattr(-,root,root)
%doc AUTHORS COPYING FUTURES LIMITATIONS NEWS POSIX.STD PROBLEMS
%doc README README_d
/bin/awk
/bin/gawk
/usr/bin/awk
/usr/bin/gawk
/usr/bin/igawk
/usr/bin/pgawk
%dir %{_libdir}/awk
%{_libdir}/awk/grcat
%{_libdir}/awk/pwcat
%dir /usr/share/awk
/usr/share/awk/*.awk
/usr/share/locale/*/LC_MESSAGES/*.mo
%doc %{_infodir}/*.info.gz
%doc %{_mandir}/man1/*.1.gz
%changelog -n gawk
* Fri Sep 01 2006 - schwab@suse.de
- Drop doc subpackage.
* Mon Jul 24 2006 - schwab@suse.de
- Add multibyte patch.
* Wed Jul 05 2006 - schwab@suse.de
- Fix conversion error.
* Tue Jul 04 2006 - schwab@suse.de
- New version of last change.
* Sun Jun 18 2006 - schwab@suse.de
- Properly handle /dev/fd.
* Sat Mar 04 2006 - schwab@suse.de
- Add two wide string bug fixes.
* Thu Feb 09 2006 - schwab@suse.de
- Fix dfa generation of interval expressions [#148453].
* Thu Jan 26 2006 - schwab@suse.de
- Use %%jobs.
* Wed Jan 25 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
* Wed Nov 30 2005 - schwab@suse.de
- Fix length on strings with embedded NUL.
* Fri Oct 07 2005 - schwab@suse.de
- Fix off-by-one when processing FIELDWIDTHS.
* Fri Sep 02 2005 - schwab@suse.de
- Update to gaw 3.1.5.
* Wed May 25 2005 - schwab@suse.de
- Update flonum parsing patch.
* Sat Feb 12 2005 - schwab@suse.de
- Add libpng to neededforbuild.
* Wed Feb 02 2005 - schwab@suse.de
- Ignore exit code from pipes.
* Tue Sep 28 2004 - schwab@suse.de
- Fix parsing of floating point number that start with more than one
zero.
* Sun Sep 19 2004 - schwab@suse.de
- Disable invalid shortcut in dfaexec [#44512].
- Fix reading past EOF.
* Mon Aug 23 2004 - schwab@suse.de
- Update to gawk 3.1.4.
* Fri Aug 06 2004 - schwab@suse.de
- Use random from glibc [#43568].
* Thu Aug 05 2004 - schwab@suse.de
- Update to gawk 3.1.3l.
* Thu Jul 22 2004 - schwab@suse.de
- Fix int/long mismatch.
* Mon Apr 05 2004 - schwab@suse.de
- Disable non-POSIX strtod replacement [#38332].
* Fri Mar 12 2004 - schwab@suse.de
- Fix doc bug.
* Sat Jan 10 2004 - adrian@suse.de
- do not strip during install, let rpm do it
* Wed Jul 09 2003 - schwab@suse.de
- Update to gawk 3.1.3.
* Thu Jun 05 2003 - jh@suse.de
- Enable profile feedback
* Tue May 13 2003 - schwab@suse.de
- Add %%defattr.
- Fix file list.
* Thu Apr 24 2003 - ro@suse.de
- fix install_info --delete call and move from preun to postun
* Mon Apr 07 2003 - schwab@suse.de
- Only delete info entries when removing last version.
* Thu Mar 27 2003 - schwab@suse.de
- Update to gawk 3.1.2.
* Fri Feb 07 2003 - schwab@suse.de
- Fix spec file.
* Thu Feb 06 2003 - schwab@suse.de
- Use %%install_info.
* Mon Nov 18 2002 - schwab@suse.de
- Add AM_GNU_GETTEXT_VERSION.
* Tue Sep 17 2002 - ro@suse.de
- removed bogus self-provides
* Mon Aug 05 2002 - schwab@suse.de
- Add fix for gsub.
* Mon Jul 29 2002 - schwab@suse.de
- Fix broken patch.
* Thu Jul 18 2002 - schwab@suse.de
- Add lint check for delete.
* Tue May 14 2002 - schwab@suse.de
- Add fix for memory leak in loops.
- Add fix for side effects in split().
* Fri May 10 2002 - schwab@suse.de
- Update to gawk-3.1.1 (bugfix release).
* Tue Apr 09 2002 - schwab@suse.de
- Fix default AWKPATH.
* Sat Mar 30 2002 - schwab@suse.de
- Fix for new gettext.
* Sun Mar 17 2002 - schwab@suse.de
- Fix buffer overflow.
* Mon Feb 18 2002 - schwab@suse.de
- Workaround spurious limitation in regex matcher.
- Fix bogus assertion in strtonum.
* Mon Jan 28 2002 - schwab@suse.de
- Add i18n patch.
* Fri Jan 11 2002 - schwab@suse.de
- Two more patches from the author:
* Fix use of getgroups
* Fix grammer in for statement.
* Fri Nov 30 2001 - schwab@suse.de
- Replace overrun patch with a better one.
- Fix provides.
* Mon Nov 26 2001 - schwab@suse.de
- Use regex from libc again.
* Wed Nov 07 2001 - schwab@suse.de
- Fix memory overrun.
* Mon Nov 05 2001 - schwab@suse.de
- Fix lint checking and off-by-one error for printf.
* Fri Oct 05 2001 - schwab@suse.de
- Fix for memory corruption bug from author.
* Tue Sep 25 2001 - schwab@suse.de
- Don't set close-on-exec on standard fd (from author).
* Thu Aug 23 2001 - schwab@suse.de
- Fix for unary minus operator from author.
* Wed Aug 08 2001 - schwab@suse.de
- Fix for memory leak from author.
* Wed Jul 25 2001 - schwab@suse.de
- Fix for empty RS and and blank input from author.
* Mon Jul 16 2001 - schwab@suse.de
- Fix for index(foo, "") from author.
* Wed Jun 13 2001 - schwab@suse.de
- Include fix for allocation bug from author.
* Mon Jun 04 2001 - schwab@suse.de
- Update to 3.1.0.
* Sun May 13 2001 - schwab@suse.de
- Use included regex.c (#7953).
* Wed May 09 2001 - cstein@suse.de
- repacked sources with bzip2.
* Thu Apr 12 2001 - schwab@suse.de
- Add patch for \<\> from author.
* Tue Mar 20 2001 - schwab@suse.de
- Add parser patch from author.
* Thu Mar 08 2001 - schwab@suse.de
- Add two patches from author.
* Tue Oct 24 2000 - schwab@suse.de
- Rename subpackage gawkdoc to gawk-doc.
* Thu Sep 14 2000 - schwab@suse.de
- Add FIELDWIDTHS bug fix from arnold@skeeve.com.
* Tue Aug 08 2000 - schwab@suse.de
- Update to 3.0.6.
* Fri Jun 30 2000 - schwab@suse.de
- Fix handling of array indexes.
* Tue Jun 27 2000 - schwab@suse.de
- Update to 3.0.5.
* Tue May 09 2000 - schwab@suse.de
- Fix symlinks.
* Mon May 08 2000 - schwab@suse.de
- Switch to BuildRoot.
- Move /usr/bin/{,g}awk to /bin.
* Fri Apr 07 2000 - bk@suse.de
- added suse autoconf update macro
* Tue Apr 04 2000 - schwab@suse.de
- Fix IGNORECASE bug.
* Fri Mar 31 2000 - schwab@suse.de
- Include more docs.
* Tue Feb 15 2000 - schwab@suse.de
- Fix parser bug.
* Tue Feb 15 2000 - schwab@suse.de
- Update config{guess,sub} to latest version.
* Tue Jan 18 2000 - schwab@suse.de
- /usr/{info,man} -> /usr/share/{info,man}
* Mon Sep 13 1999 - bs@suse.de
- ran old prepare_spec on spec file to switch to new prepare_spec.
* Fri Aug 27 1999 - schwab@suse.de
- specfile cleanup
- run "make check"
- use regex from libc
* Mon Jul 19 1999 - florian@suse.de
- update to gawk 3.0.4
* Thu Dec 10 1998 - florian@suse.de
- egcs miscompiles gawk, use gcc instead
* Fri Jul 17 1998 - werner@suse.de
- Use mktemp for igawk
* Wed May 13 1998 - ro@suse.de
- used dif from jurix-mirror (date Mar 7 1998)
- some of the patches from gnu.utils.bug are still buggy. applied some new
patches from the author Aharon Robbins to field.c.
* Mon Mar 02 1998 - florian@suse.de
- use a complete new patchkit from various bug-reports
to gnu.utils.bug
* Wed Feb 04 1998 - ro@suse.de
- build gawkdoc from same specfile
* Thu Oct 09 1997 - florian@suse.de
- prepare for autobuild
* Fri Jul 18 1997 - florian@suse.de
- add bug-fixes from gnu.utils.bug
- add several patches from gnu.utils.bug
- gawk should work with c-news again
* Tue May 20 1997 - florian@suse.de
- update to version 3.0.3
* Sun Apr 13 1997 - florian@suse.de
- add bug-fixes from gnu.utils.bugs
- do not use /usr/libexec anymore
* Wed Jan 22 1997 - florian@suse.de
- update to version 3.0.2

200
multibyte.diff Normal file
View File

@ -0,0 +1,200 @@
From nobody Mon Jul 24 10:25:07 2006
From: Aharon Robbins <arnold@skeeve.com>
Subject: gawk 3.1.5, patch for multibyte locales
To: bug-gnu-utils@gnu.org
Date: Sun, 23 Jul 2006 22:30:56 +0300
Greetings all.
The problem with gawk and multibyte locales has come up enough that it's
time to post a patch. This is extracted from my current code base.
It is untested but should do the trick.
At least now it'll be in the mailing list archives.
Arnold
-------------------------------
Fri Mar 10 06:28:23 2006 Arnold D. Robbins <arnold@skeeve.com>
* awk.h (free_wstr): New declaration if MBS_SUPPORT, empty macro
otherwise.
* node.c (free_wstr): New function, inside MBS_SUPPORT. Frees the wide
string part of a node. Provided so that it can be used consistently
everywhere.
(format_val, r_dupnode, mk_number, make_str_node, unref): Use it.
* builtin.c (sub_common): Call `free_wstr' instead of doing it manually.
* eval.c (r_tree_eval): Same in Node_assign_concat case.
* field.c (set_field, rebuild_record, set_record): Add calls to `free_wstr'.
Mon Feb 13 22:45:34 2006 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (r_tree_eval): Node_assign_concat. Release any
wide string value and reset the WSTRCUR flag. Based on
bug report by Karal Zak.
diff -u ../gawk-3.1.5/awk.h ./awk.h
--- ../gawk-3.1.5/awk.h 2005-07-26 21:07:43.000000000 +0300
+++ ./awk.h 2006-03-10 06:35:14.000000000 +0200
@@ -1166,6 +1166,9 @@
#define force_wstring(n) str2wstr(n, NULL)
extern const wchar_t *wstrstr P((const wchar_t *haystack, size_t hs_len, const wchar_t *needle, size_t needle_len));
extern const wchar_t *wcasestrstr P((const wchar_t *haystack, size_t hs_len, const wchar_t *needle, size_t needle_len));
+extern void free_wstr P((NODE *n));
+#else
+#define free_wstr(NODE) /* empty */
#endif
/* re.c */
extern Regexp *make_regexp P((const char *s, size_t len, int ignorecase, int dfa));
diff -u ../gawk-3.1.5/builtin.c ./builtin.c
--- ../gawk-3.1.5/builtin.c 2005-07-26 21:07:43.000000000 +0300
+++ ./builtin.c 2006-03-10 06:55:00.000000000 +0200
@@ -2462,6 +2462,7 @@
free(t->stptr);
t->stptr = buf;
t->stlen = textlen;
+ free_wstr(t);
free_temp(s);
if (matches > 0 && lhs) {
diff -u ../gawk-3.1.5/eval.c ./eval.c
--- ../gawk-3.1.5/eval.c 2005-07-26 21:07:43.000000000 +0300
+++ ./eval.c 2006-07-04 22:41:25.000000000 +0300
@@ -1176,6 +1176,7 @@
memcpy(l->stptr + l->stlen, r->stptr, r->stlen);
l->stlen += r->stlen;
l->stptr[l->stlen] = '\0';
+ free_wstr(l);
} else {
char *nval;
size_t nlen = l->stlen + r->stlen + 2;
diff -u ../gawk-3.1.5/field.c ./field.c
--- ../gawk-3.1.5/field.c 2005-05-11 18:28:15.000000000 +0300
+++ ./field.c 2006-03-10 06:48:22.000000000 +0200
@@ -129,6 +129,7 @@
n->stptr = str;
n->stlen = len;
n->flags = (STRCUR|STRING|MAYBE_NUM|FIELD);
+ free_wstr(n);
}
/* rebuild_record --- Someone assigned a value to $(something).
@@ -210,6 +211,7 @@
}
n->stptr = cops;
+ free_wstr(n);
unref(fields_arr[i]);
fields_arr[i] = n;
}
@@ -273,6 +275,7 @@
n->type = Node_val;
n->stfmt = -1;
n->flags = (STRING|STRCUR|MAYBE_NUM|FIELD);
+ free_wstr(n);
fields_arr[0] = n;
#undef INITIAL_SIZE
diff -u ../gawk-3.1.5/node.c ./node.c
--- ../gawk-3.1.5/node.c 2005-07-26 21:07:43.000000000 +0300
+++ ./node.c 2006-03-10 07:04:25.000000000 +0200
@@ -216,15 +218,7 @@
no_malloc:
s->stref = 1;
s->flags |= STRCUR;
-#if defined MBS_SUPPORT
- if ((s->flags & WSTRCUR) != 0) {
- assert(s->wstptr != NULL);
- free(s->wstptr);
- s->wstptr = NULL;
- s->wstlen = 0;
- s->flags &= ~WSTRCUR;
- }
-#endif
+ free_wstr(s);
return s;
}
@@ -287,7 +281,12 @@
*r = *n;
r->flags &= ~(PERM|TEMP|FIELD);
r->flags |= MALLOC;
-#if defined MBS_SUPPORT
+#ifdef MBS_SUPPORT
+ /*
+ * DON'T call free_wstr(r) here!
+ * r->wstptr still points at n->wstptr's value, and we
+ * don't want to free it!
+ */
r->wstptr = NULL;
#endif /* defined MBS_SUPPORT */
if (n->type == Node_val && (n->flags & STRCUR) != 0) {
@@ -344,11 +343,7 @@
r->stref = 1;
r->stptr = NULL;
r->stlen = 0;
-#if defined MBS_SUPPORT
- r->wstptr = NULL;
- r->wstlen = 0;
- r->flags &= ~WSTRCUR;
-#endif /* MBS_SUPPORT */
+ free_wsptr(r);
#endif /* GAWKDEBUG */
return r;
}
@@ -363,10 +358,7 @@
getnode(r);
r->type = Node_val;
r->flags = (STRING|STRCUR|MALLOC);
-#if defined MBS_SUPPORT
- r->wstptr = NULL;
- r->wstlen = 0;
-#endif
+ free_wstr(r);
if (flags & ALREADY_MALLOCED)
r->stptr = s;
else {
@@ -510,15 +502,7 @@
return;
}
free(tmp->stptr);
-#if defined MBS_SUPPORT
- if (tmp->wstptr != NULL) {
- assert((tmp->flags & WSTRCUR) != 0);
- free(tmp->wstptr);
- }
- tmp->flags &= ~WSTRCUR;
- tmp->wstptr = NULL;
- tmp->wstlen = 0;
-#endif
+ free_wstr(tmp);
}
freenode(tmp);
return;
@@ -775,6 +759,21 @@
return n;
}
+/* free_wstr --- release the wide string part of a node */
+
+void
+free_wstr(NODE *n)
+{
+
+ if ((n->flags & WSTRCUR) != 0) {
+ assert(n->wstptr != NULL);
+ free(n->wstptr);
+ }
+ n->wstptr = NULL;
+ n->wstlen = 0;
+ n->flags &= ~WSTRCUR;
+}
+
#if 0
static void
dump_wstr(FILE *fp, const wchar_t *str, size_t len)
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils

69
numeric-conversion.diff Normal file
View File

@ -0,0 +1,69 @@
From nobody Wed Jul 5 10:39:02 2006
From: Aharon Robbins <arnold@skeeve.com>
Subject: Re: conversion error
To: bug-gawk@gnu.org, Heiner.Marxen@DrB.Insel.DE
Cc:
Date: Tue, 04 Jul 2006 22:46:47 +0300
Greetings. Re this:
> Date: Tue, 04 Jul 2006 21:06:14 +0200 (MEST)
> From: Heiner Marxen <Heiner.Marxen@DrB.Insel.DE>
> Subject: conversion error
> To: bug-gawk@gnu.org
>
> Hello,
>
> The following awk script fails for gawk 3.1.4 and 3.1.5.
> Older versions did not do this, but I cannot say, how old they were.
>
> BEGIN {
> if( 0 ) { #ok
> t = "8"
> }else { #fails
> t = ""
> t = t "8"
> }
> printf("8 = %d\n", 0+t) # ok without this line
> t = t "8" # does not invalidate numeric interpretation
> printf("88 = %s\n", 0+t)
> ## The above prints "88 = 8" with gawk 3.1.4 and 3.1.5
> }
>
> The following one-liner already exhibits the bug:
>
> gawk 'BEGIN{t=""; t=t "8";printf("8=%d\n", 0+t);t=t "8";printf("88=%s\n", 0+t)}'
>
>
> Preliminary observation: under somewhat strange conditions a variable
> does retain its numeric interpretation although something is appended to it.
> --
> Heiner Marxen http://www.drb.insel.de/~heiner/
This is an excellent bug report and test case. Much thanks. The following
patch fixes the problem.
Arnold
----------------------------------------------------
Tue Jul 4 22:43:05 2006 Arnold D. Robbins <arnold@skeeve.com>
* eval.c (interpret): Node_assign_concat case: Turn off NUMBER and NUMCUR
flags in result. Sheesh. Thanks to <Heiner.Marxen@DrB.Insel.DE> for finding
the problem.
--- ../gawk-3.1.5/eval.c 2005-07-26 21:07:43.000000000 +0300
+++ eval.c 2006-07-04 22:41:25.000000000 +0300
@@ -1186,6 +1187,7 @@
unref(*lhs);
*lhs = make_str_node(nval, l->stlen + r->stlen, ALREADY_MALLOCED);
}
+ (*lhs)->flags &= ~(NUMCUR|NUMBER);
free_temp(r);
if (after_assign)
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils

11
parallel-make.diff Normal file
View File

@ -0,0 +1,11 @@
--- awklib/Makefile.am
+++ awklib/Makefile.am
@@ -59,6 +59,8 @@
$(AWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi $(srcdir)/../doc/gawkinet.texi
@echo 'some makes are stupid and will not check a directory' > stamp-eg
@echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
+$(srcdir)/eg/lib/pwcat.c $(srcdir)/eg/lib/grcat.c $(srcdir)/eg/prog/igawk.sh \
+$(srcdir)/eg/lib/passwdawk.in $(srcdir)/eg/lib/groupawk.in: stamp-eg; @:
pwcat$(EXEEXT): $(srcdir)/eg/lib/pwcat.c
$(COMPILE) $(srcdir)/eg/lib/pwcat.c $(LDFLAGS) -o $@

0
ready Normal file
View File

71
sub-common.diff Normal file
View File

@ -0,0 +1,71 @@
From nobody Sat Mar 4 22:53:59 2006
From: KIMURA Koichi <kimura.koichi@canon.co.jp>
Subject: gawk: sub_common has multi-byte aware bug
To: bug-gawk@gnu.org
Cc:
Date: Mon, 27 Feb 2006 12:35:30 +0900
Hi,
A certain user faced bug of sub builtin function and report to me.
Then I investigated the bug.
reproduce script is here.
BEGIN {
str = "type=\"directory\" version=\"1.0\""
#print "BEGIN:", str
while (str) {
sub(/^[^=]*/, "", str);
s = substr(str, 2)
print s
sub(/^="[^"]*"/, "", str)
sub(/^[ \t]*/, "", str)
}
}
and sample result is here (on GNU/Linux Fedora core 3)
[kbk@skuld gawk-3.1.5]$ LC_ALL=C ./gawk -f subbug.awk
"directory" version="1.0"
"1.0"
[kbk@skuld gawk-3.1.5]$ LC_ALL=en_US.UTF-8 ./gawk -f subbug.awk
"directory" version="1.0"
"dire
[kbk@skuld gawk-3.1.5]$
In my investigation, this bug is cause by don't release wide-string when
sub is executed.
patch is here.
--- builtin.c.orig 2005-07-27 03:07:43.000000000 +0900
+++ builtin.c 2006-02-26 02:07:52.000000000 +0900
@@ -2463,6 +2468,15 @@ sub_common(NODE *tree, long how_many, in
t->stptr = buf;
t->stlen = textlen;
+#ifdef MBS_SUPPORT
+ if (t->flags & WSTRCUR) {
+ if (t->wstptr != NULL)
+ free(t->wstptr);
+ t->wstptr = NULL;
+ t->wstlen = 0;
+ t->flags &= ~WSTRCUR;
+ }
+#endif
free_temp(s);
if (matches > 0 && lhs) {
if (priv) {
--
KIMURA Koichi
_______________________________________________
bug-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-utils