--- mawk-1.3.3.orig/scan.c +++ mawk-1.3.3/scan.c @@ -1033,6 +1033,15 @@ STRING *sval ; while (1) + { + if (p == string_buff + SPRINTF_SZ - 2) + { + compile_error( + "regular expression /%.10s ..." + " exceeds implementation size limit", + string_buff) ; + mawk_exit(2) ; + } switch (scan_code[*p++ = next()]) { case SC_DIV: /* done */ @@ -1070,6 +1079,7 @@ } break ; } + } out: /* now we've got the RE, so compile it */ --- mawk-1.3.3.orig/debian/changelog +++ mawk-1.3.3/debian/changelog @@ -0,0 +1,328 @@ +mawk (1.3.3-15ubuntu2.0.10.04) lucid-proposed; urgency=low + + * Replace memcpy by memmove in FINgets. + (LP: #955791) + + -- Tom de Vries Sat, 17 Mar 2012 21:04:54 +0100 + +mawk (1.3.3-15ubuntu2) lucid; urgency=low + + * Compute md5sums; Debian #507315. + + -- Loïc Minier Tue, 12 Jan 2010 00:02:00 +0100 + +mawk (1.3.3-15ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: LP: #405721 + - Do not crash if regexp is too long for our buffer. + LP: #23494, Debian Bug: #391051. + - autopkgtest/autodebtest now supported - upstream tests wired in. + + -- Bhavani Shankar Tue, 28 Jul 2009 15:46:22 +0530 + +mawk (1.3.3-15) unstable; urgency=high + + * Fix debian/copyright to correctly list the license as GPLv2, not GPLv2 + or later. Closes: #536689 + + -- Steve Langasek Mon, 27 Jul 2009 11:26:47 -0700 + +mawk (1.3.3-14ubuntu1) karmic; urgency=low + + * Merge from debian unstable, remaining changes: + - Do not crash if regexp is too long for our buffer. + LP: #23494, Debian Bug: #391051. + - autopkgtest/autodebtest now supported - upstream tests wired in. + + -- Michael Vogt Tue, 28 Apr 2009 21:33:12 +0200 + +mawk (1.3.3-14) unstable; urgency=low + + * Build-Conflict with byacc, as the current version doesn't appear to be + compatible with mawk; though we ought to fix the upstream build rules + to not check for byacc first in this case, this is an ok fix for now. + Closes: #509832. + + -- Steve Langasek Fri, 26 Dec 2008 16:17:53 -0800 + +mawk (1.3.3-13ubuntu1) jaunty; urgency=low + + * Merge from debian unstable, remaining changes: + - Do not crash if regexp is too long for our buffer. + LP: #23494, Debian Bug: #391051. + - autopkgtest/autodebtest now supported - upstream tests wired in. + + -- Scott James Remnant Wed, 05 Nov 2008 06:42:01 +0000 + +mawk (1.3.3-13) unstable; urgency=low + + * New maintainer; closes: #496711. + * Drop versioned gcc build-dependency, which has been satisfied since + before oldstable. + * debian/rules: fix up clean target to use a simpler, standard distclean + call, fixing a lintian warning. + * debian/rules: future-proof the clean target for patch interaction + with the build system, moving all the cleaning into a + "clean-patched" target that fires before the unpatch target + + -- Steve Langasek Wed, 27 Aug 2008 10:03:33 -0700 + +mawk (1.3.3-12) unstable; urgency=low + + * New maintainer; closes: 496711 + * Fix the following lintian issues: + W: ancient-standards-version 3.5.10.0 (current is 3.8.0) + W: mawk: unknown-section base + W: mawk: old-fsf-address-in-copyright-file + + -- Anibal Monsalve Salazar Wed, 27 Aug 2008 17:41:50 +1000 + +mawk (1.3.3-11.1ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - Do not crash if regexp is too long for our buffer. (LP #23494) + - autopkgtest/autodebtest now supported - upstream tests wired in. + + -- Michael Vogt Tue, 06 May 2008 11:49:05 +0200 + +mawk (1.3.3-11.1) unstable; urgency=low + + * Non-maintainer upload. + * debian/postinst: fix bashism. Closes: #308134 + + -- Peter Eisentraut Sat, 05 Apr 2008 17:11:11 +0200 + +mawk (1.3.3-11ubuntu2) edgy; urgency=low + + * Do not crash if regexp is too long for our buffer. (LP 23494.) + + -- Ian Jackson Wed, 4 Oct 2006 16:07:11 +0100 + +mawk (1.3.3-11ubuntu1) dapper; urgency=low + + * autopkgtest/autodebtest now supported - upstream tests wired in. + + -- Ian Jackson Tue, 7 Feb 2006 17:45:13 +0000 + +mawk (1.3.3-11) unstable; urgency=low + + * 08_fix-for-gcc3.3.dpatch: grossly hack configure to work around + gcc-3.3 providing a builtin log() function which broke the configure + tests. Thanks to Daniel Schepler for the + report. Closes: #195371 + + * debian/control: add build-depends on gcc (>= 3:3.3-1) for hppa. + * debian/rules: remove de-optimization hack for hppa. Thanks to LaMont + Jones and Matthias Klose + . Closes: #105816 + + * debian/control (Standards-Version): bump to 3.5.10.0. + + -- James Troup Fri, 30 May 2003 15:24:50 +0100 + +mawk (1.3.3-10) unstable; urgency=low + + * Move to dpatch; existing non-debian/ changes split into + 01_error-on-full-fs, 02_fix-examples, 03_read-and-close-redefinition, + 04_mawk.1-fix-pi and 05_-Wall-fixes. + * debian/rules: include /usr/share/dpatch/dpatch.make. + * debian/rules (build): depend on patch-stamp. + * debian/rules (clean): depend on unpatch. Remove debian/patched. + * debian/control (Build-Depends): add dpatch. + + * debian/rules: update copyright and use install_foo convenience + variables. + * debian/copyright: update copyright. + + * debian/control (Standards-Version): bump to 3.5.9.0. + * debian/postinst, debian/prerm: no longer do /usr/doc symlinks. + + * debian/prerm: use set -e rather than #!/bin/sh -e. + + * 06_parse.y-semicolons.dpatch: new patch to fix missing semi-colons + that upset recent versions of bison. Thanks to Paul Eggert + . Closes: #170973 + * debian/control (Build-Depends): add bison. + * debian/rules (clean): remove parse.c and parse.h so they're not + included in the .diff.gz. + + * 07_mawktest-check-devfull: new patch to conditionalize the write error + tests on the existence of /dev/full since apparently some systems + don't have it. Requested by Marcus.Brinkmann@ruhr-uni-bochum.de. + Closes: #51875 + + * debian/postinst: demote mawk to priority 5 so that gawk will be + selected by default. [mawk isn't being actively maintained upstream + and has both long-standing bugs and isn't feature-complete WRT POSIX + at least.] + + -- James Troup Thu, 10 Apr 2003 02:22:27 +0100 + +mawk (1.3.3-9) unstable; urgency=low + + * debian/control: capitalize POSIX, thanks to Matt Zimmerman + . Closes: #125120 + * debian/changelog: remove obsolete local variables. + * man/mawk.1: add a macro provided by Colin Watson + to force PI to be displayed as "pi" (rather than 'n') when processed + by nroff. Closes: #103699 + * debian/control (Standards-Version): update to 3.5.6.1. + + -- James Troup Fri, 9 Aug 2002 15:04:23 +0100 + +mawk (1.3.3-8) unstable; urgency=low + + * debian/rules (build): compile with -O1 on hppa to work around probable + compiler bug. Thanks to LaMont Jones . + + -- James Troup Wed, 18 Jul 2001 20:40:37 +0100 + +mawk (1.3.3-7) unstable; urgency=low + + * mawk.h: remove bogus redefinition of read() and close() and #include + instead, thanks to LaMont Jones . + Closes: #104124 + + -- James Troup Tue, 10 Jul 2001 03:09:24 +0100 + +mawk (1.3.3-6) unstable; urgency=low + + * debian/control (Maintainer): fixed to be me. + * debian/changelog: remove add-log-mailing-address. + * debian/rules: rewritten. + * debian/control (Standards-Version): bump to 3.5.5.0. + * Half hearted attempt at -Wall cleaning of the code. + + -- James Troup Mon, 25 Jun 2001 05:33:51 +0100 + +mawk (1.3.3-5) unstable; urgency=low + + * debian/postinst: manpages are in /usr/share/man now; forgot to update + the arguments to update-alternatives. Thanks to Malcolm Parsons + for noticing. [#54440] + + -- James Troup Sun, 9 Jan 2000 16:54:14 +0000 + +mawk (1.3.3-4) unstable; urgency=low + + * debian/rules (build): make configure and the test scripts executables + to make builds work under aegis. + * debian/copyright: remove references to Linux. Update location of the + GPL. We are mawk, not hello. + * debian/rules (binary-arch): move to FHS; install documentation into + /usr/share/doc/ and manpages into /usr/share/man/. + * debian/postinst: add /usr/doc/ symlink. + * debian/prerm: remove /usr/doc/ symlink. + * debian/control (Standards-Version): update to 3.1.1.1. + * debian/rules (binary-arch): pass -isp to dpkg-gencontrol. + + -- James Troup Fri, 31 Dec 1999 13:53:42 +0000 + +mawk (1.3.3-3) unstable; urgency=low + + * debian/rules (binary-arch): add chmod -R go=rX to correct permissions + on directories. + * debian/control (Standards-Version): update [FSVO] to 2.5.0.0. + + * The following entries are a patch from Torsten Landschoff + . [#4293, #28249] + * files.c: Added handling of write errors delivered when closing the + output file. + * test/mawktest: Added checking for correct handling of write errors on + full disks. + + * The remaining entries are a patch from Edward Betts + . [#36011] + * examples/hical: use /bin/echo to avoid bash's builtin. + * examples/{ct_length.awk,eatc.awk,nocomment,primes,qsort}: fix bang + path. + * examples/{decl.awk,gdecl.awk,hcal}: fix bang path, remove trailing + white space. + + -- James Troup Fri, 8 Oct 1999 18:26:49 +0100 + +mawk (1.3.3-2) frozen unstable; urgency=low + + * debian/control (Maintainer): New maintainer. However, I'm just an + interim real maintainer, the package will go back to Chris as soon as + he's ready. + * debian/control (Standards-Version): Upgraded to 2.4.1.0. + * debian/control (Depends): Made a Pre-Depends. [#20601] + * debian/copyright: corrected URL of upstream source. [#20603] + * debian/copyright: updated the address of the FSF. + * Pristine upstream source. + + -- James Troup Thu, 30 Apr 1998 16:02:45 +0200 + +mawk (1.3.3-1.1) unstable; urgency=low + + * Non-maintainer release. + * Rebuilt under libc6 [#11707]. + + -- James Troup Fri, 3 Oct 1997 20:19:36 +0200 + +mawk (1.3.3-1) unstable; urgency=low + + * Upgrade to latest upstream source (very minor bug fix) + * Change update-alternatives links to reflect compressed man pages. + * postinst: remove bad links in /usr/man/man1. + + -- Chris Fearnley Fri, 7 Mar 1997 14:41:20 -0500 + +mawk (1.3.2-3) unstable; urgency=low + + * I accidently built the last mawk from my hacked source :( + This version reverts to the pristine upstream (but fails to + completely close Bug #4293 -- which was the point of the dubious + hack found in mawk-1.3.2-2). Sorry. Glad I noticed so soon! + + -- Chris Fearnley Sun, 3 Nov 1996 22:57:45 -0500 + +mawk (1.3.2-2) unstable; urgency=low + + * Fixed postinst to install awk and nawk man pages correctly (bug#5001) + + -- Chris Fearnley Sun, 3 Nov 1996 22:28:56 -0500 + +mawk (1.3.2-1) unstable; urgency=low + + * upgrade to latest upstream source (solves bug #4293) + * development environment: gcc-2.7.2.1-1, libc5-5.2.18-10, + libc5-dev-5.2.18-10, binutils-2.6-2, and make-3.74-12 + + -- Chris Fearnley Sat, 28 Sep 1996 22:58:42 -0400 + +mawk (1.3.1-1) unstable; urgency=low + + * upgrade to latest upstream source + * upgrade packaging to Debian Standards-Version 2.1.1.0 + * i386 development environment: gcc-2.7.2.1-1, libc5-5.2.18-10, + libc5-dev-5.2.18-10, binutils-2.6-2, and make-3.74-12 + + -- Chris Fearnley Wed, 18 Sep 1996 14:24:31 -0400 + +mawk (1.2.2-2) unstable; urgency=low + + * upgrade to latest debian packaging guidelines + * provides: awk + * mawk is now the default awk/nawk for Debian GNU/Linux + * Development environment for i386: gcc-2.7.2-8 libc5-5.2.18-9 make-3.74-12 + * Section: base ; Priority: important + + -- Chris Fearnley Wed, 7 Aug 1996 21:51:21 -0400 + +mawk (1.2.2-1) unstable; urgency=low + + * Upgrade to new upsteam version + * Compiled with: gcc-2.7.2-2, binutils-2.6-2, and libc5-5.2.18-1. + + -- Chris Fearnley Mon, 29 Jan 1996 04:02:39 -0400 + +mawk (1.2.1-1) unstable; urgency=low + + * added Debian GNU/Linux package maintenance system files + * patched Makefile.in to make debianization more flexible + * initial release - ELF package + + -- Chris Fearnley Sun, 3 Dec 1995 00:48:23 -0400 + --- mawk-1.3.3.orig/debian/rules +++ mawk-1.3.3/debian/rules @@ -0,0 +1,81 @@ +#!/usr/bin/make -f +# debian/rules file - for Mawk (1.3.3) +# Based on sample debian/rules file - for GNU Hello (1.3). +# Copyright 1994,1995 by Ian Jackson. +# Copyright 2001-2003 James Troup +# I hereby give you perpetual unlimited permission to copy, +# modify and relicense this file, provided that you do not remove +# my name from the file itself. (I assert my moral right of +# paternity under the Copyright, Designs and Patents Act 1988.) +# This file may have to be extensively modified + +install_dir=install -d -m 755 +install_file=install -m 644 +install_script=install -m 755 +install_binary=install -m 755 -s + +include /usr/share/dpatch/dpatch.make + +build: patch-stamp + $(checkdir) + chmod 755 configure test/mawktest test/fpe_test + ./configure + $(MAKE) CC="$(CC)" CFLAGS="-g -Wall -O2" LDFLAGS="$(LDFLAGS)" + touch build + +clean: clean-patched unpatch + -rm -rf debian/patched + +clean-patched: + $(checkdir) + -rm -f build parse.c parse.h + [ ! -f Makefile ] || make distclean + -rm -f man/index.db + -rm -rf debian/tmp debian/substvars debian/files* + find . -name \*~ | xargs rm -vf + +binary-indep: + +binary-arch: checkroot build + $(checkdir) + rm -rf debian/tmp + + $(install_dir) debian/tmp/DEBIAN + $(install_script) debian/prerm debian/postinst debian/tmp/DEBIAN/ + + $(install_dir) debian/tmp/usr/bin + $(install_binary) mawk debian/tmp/usr/bin/ + + $(install_dir) debian/tmp/usr/share/man/man1 + $(install_file) man/mawk.1 debian/tmp/usr/share/man/man1/ + gzip -9v debian/tmp/usr/share/man/man1/mawk.1 + + $(install_dir) debian/tmp/usr/share/doc/mawk/ + $(install_file) CHANGES debian/tmp/usr/share/doc/mawk/changelog + $(install_file) debian/changelog debian/tmp/usr/share/doc/mawk/changelog.Debian + $(install_file) README ACKNOWLEDGMENT debian/tmp/usr/share/doc/mawk/ + gzip -9v debian/tmp/usr/share/doc/mawk/* + + $(install_dir) debian/tmp/usr/share/doc/mawk/examples + $(install_file) examples/* debian/tmp/usr/share/doc/mawk/examples/ + gzip -9v debian/tmp/usr/share/doc/mawk/examples/* + + $(install_file) debian/copyright debian/tmp/usr/share/doc/mawk/ + + cd debian/tmp && find -type f \! -regex '.*/DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum >DEBIAN/md5sums + + dpkg-shlibdeps mawk + dpkg-gencontrol -isp + chown -R root.root debian/tmp + chmod -R go=rX debian/tmp + dpkg --build debian/tmp .. + +# Below here is fairly generic really + +binary: binary-indep binary-arch + +checkroot: + $(checkdir) + test root = "`whoami`" + +.PHONY: binary binary-arch binary-indep clean checkroot --- mawk-1.3.3.orig/debian/copyright +++ mawk-1.3.3/debian/copyright @@ -0,0 +1,28 @@ +This is the Debian GNU prepackaged version of mawk, an implementation +of the AWK Programming Language. mawk was written by Mike Brennan + + +This package was put together by Chris Fearnley , +from sources obtained from: + ftp://ftp.whidbey.net/pub/brennan/mawk1.3.3.tar.gz + +It is currently being maintained by James Troup . + +mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan +Modifications for Debian GNU/Linux Copyright (C) 1995-96 Chris Fearnley. +Modifications for Debian GNU/Linux Copyright (C) 1998-2003 James Troup. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License version 2 as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License with +your Debian GNU system, in /usr/share/common-licenses/GPL-2, or with the +Debian GNU mawk source package as the file COPYING. If not, write to +the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +Boston, MA 02110-1301, USA. --- mawk-1.3.3.orig/debian/postinst +++ mawk-1.3.3/debian/postinst @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +update-alternatives --quiet --install /usr/bin/awk awk /usr/bin/mawk 5 \ + --slave /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/mawk.1.gz \ + --slave /usr/bin/nawk nawk /usr/bin/mawk \ + --slave /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/mawk.1.gz +for badlink in /usr/man/man1/awk.1 /usr/man/man1/nawk.1 /usr/share/man/man1/awk.1 /usr/share/man/man1/nawk.1; do + if [ -L $badlink ]; then + if ! ls -l $(ls -l $badlink | cut -d">" -f2) >/dev/null 2>&1; then + rm -f $badlink; fi; fi; done + +exit 0 --- mawk-1.3.3.orig/debian/prerm +++ mawk-1.3.3/debian/prerm @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" != "upgrade" ]; then + update-alternatives --remove awk /usr/bin/mawk +fi + +exit 0 --- mawk-1.3.3.orig/debian/control +++ mawk-1.3.3/debian/control @@ -0,0 +1,26 @@ +Source: mawk +Section: utils +Priority: required +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Steve Langasek +Build-Depends: dpatch, bison +Build-Conflicts: byacc +Standards-Version: 3.8.2 + +Package: mawk +Architecture: any +Provides: awk +Pre-Depends: ${shlibs:Depends} +Description: a pattern scanning and text processing language + Mawk is an interpreter for the AWK Programming Language. The AWK + language is useful for manipulation of data files, text retrieval and + processing, and for prototyping and experimenting with algorithms. Mawk + is a new awk meaning it implements the AWK language as defined in Aho, + Kernighan and Weinberger, The AWK Programming Language, Addison-Wesley + Publishing, 1988. (Hereafter referred to as the AWK book.) Mawk conforms + to the POSIX 1003.2 (draft 11.3) definition of the AWK language + which contains a few features not described in the AWK book, and mawk + provides a small number of extensions. + . + Mawk is smaller and much faster than gawk. It has some compile-time + limits such as NF = 32767 and sprintf buffer = 1020. --- mawk-1.3.3.orig/debian/tests/mawktest +++ mawk-1.3.3/debian/tests/mawktest @@ -0,0 +1,9 @@ +#!/bin/sh +set -e +sed -e ' + /^PATH=/d; + /^mawk -W version/ s/$/ 2>&1/; +' "$TMPDIR/mawktest" +chmod +x "$TMPDIR/mawktest" +cd test +"$TMPDIR/mawktest" --- mawk-1.3.3.orig/debian/tests/control +++ mawk-1.3.3/debian/tests/control @@ -0,0 +1,2 @@ +Tests: mawktest +Restrictions: rw-build-tree --- mawk-1.3.3.orig/debian/patches/00list +++ mawk-1.3.3/debian/patches/00list @@ -0,0 +1,9 @@ +01_error-on-full-fs +02_fix-examples +03_read-and-close-redefinition +04_mawk.1-fix-pi +05_-Wall-fixes +06_parse.y-semicolons +07_mawktest-check-devfull +08_fix-for-gcc3.3 +21_memcpy-to-memmove.dpatch --- mawk-1.3.3.orig/debian/patches/01_error-on-full-fs.dpatch +++ mawk-1.3.3/debian/patches/01_error-on-full-fs.dpatch @@ -0,0 +1,208 @@ +#! /bin/sh -e +## 01_error-on-full-fs.dpatch by Torsten Landschoff +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Report errors when writing to a full filesystem, even if we +## DP: are only notified about them when closing the file. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 01.mawk.tmp/files.c 01.mawk/files.c +--- 01.mawk.tmp/files.c 1996-01-14 17:14:10.000000000 +0000 ++++ 01.mawk/files.c 2003-04-09 22:05:20.000000000 +0100 +@@ -61,17 +61,11 @@ + #include "memory.h" + #include "fin.h" + +-static FILE *PROTO(tfopen, (char *, char *)) ; +-static void PROTO(efflush, (FILE*)) ; +-static void PROTO(add_to_child_list, (int, int)) ; +-static struct child *PROTO(remove_from_child_list, (int)) ; +-extern int PROTO(isatty, (int)) ; + + #ifdef V7 + #include /* defines FIOCLEX */ + #endif + +- + #ifndef NO_FCNTL_H + + #include +@@ -103,6 +97,14 @@ + + static FILE_NODE *file_list ; + ++/* Prototypes for local functions */ ++ ++static FILE *PROTO(tfopen, (char *, char *)) ; ++static void PROTO(efflush, (FILE*)) ; ++static void PROTO(add_to_child_list, (int, int)) ; ++static struct child *PROTO(remove_from_child_list, (int)) ; ++extern int PROTO(isatty, (int)) ; ++static void PROTO(close_error, (FILE_NODE *p)); + + /* find a file on file_list */ + PTR +@@ -233,16 +235,28 @@ + if (strcmp(name, p->name->str) == 0) + { + /* found */ +- switch (p->type) ++ ++ /* Remove it from the list first because we might be called ++ again if an error occurs leading to an infinite loop. ++ ++ Note that we don't have to consider the list corruption ++ caused by a recursive call because it will never return. */ ++ ++ q->link = p->link ; ++ file_list = dummy.link ; /* maybe it was the first file */ ++ ++ switch (p->type) + { + case F_TRUNC: + case F_APPEND: +- fclose((FILE *) p->ptr) ; ++ if( fclose((FILE *) p->ptr) != 0 ) ++ close_error(p) ; + retval = 0 ; + break ; + + case PIPE_OUT: +- fclose((FILE *) p->ptr) ; ++ if( fclose((FILE *) p->ptr) != 0 ) ++ close_error(p) ; + + #if HAVE_REAL_PIPES + retval = wait_for(p->pid) ; +@@ -274,8 +288,8 @@ + } + + free_STRING(p->name) ; +- hold = p ; +- q->link = p = p->link ; ++ hold = p ; ++ p = p->link ; + ZFREE(hold) ; + } + else +@@ -284,7 +298,6 @@ + } + } + +- file_list = dummy.link ; + return retval ; + } + +@@ -364,7 +377,14 @@ + { + if (IS_OUTPUT(p->type)) + { +- fclose((FILE *) p->ptr) ; ++ if( fclose((FILE *) p->ptr) != 0 ) ++ { ++ /* if another error occurs we do not want to be called ++ for the same file again */ ++ ++ file_list = p->link ; ++ close_error(p) ; ++ } + if (p->type == PIPE_OUT) wait_for(p->pid) ; + } + +@@ -397,7 +417,8 @@ + { + if (p->type == PIPE_OUT) + { +- fclose(p->ptr) ; ++ if( fclose(p->ptr) != 0 ) ++ close_error(p) ; + close_fake_outpipe(p->name->str, p->pid) ; + } + p = p->link ; +@@ -563,18 +584,24 @@ + set_stderr() /* and stdout */ + { + FILE_NODE *p, *q ; ++ ++ /* We insert stderr first to get it at the end of the list. This is ++ needed because we want to output errors encountered on closing ++ stdout. */ + +- p = ZMALLOC(FILE_NODE) ; +- p->link = (FILE_NODE*) 0 ; +- p->type = F_TRUNC ; +- p->name = new_STRING("/dev/stdout") ; +- p->ptr = (PTR) stdout ; + q = ZMALLOC(FILE_NODE); +- q->link = p ; ++ q->link = (FILE_NODE*) 0 ; + q->type = F_TRUNC ; + q->name = new_STRING("/dev/stderr") ; + q->ptr = (PTR) stderr ; +- file_list = q ; ++ ++ p = ZMALLOC(FILE_NODE) ; ++ p->link = q; ++ p->type = F_TRUNC ; ++ p->name = new_STRING("/dev/stdout") ; ++ p->ptr = (PTR) stdout ; ++ ++ file_list = p ; + } + + /* fopen() but no buffering to ttys */ +@@ -619,3 +646,13 @@ + } + } + #endif /* MSDOS */ ++ ++/* An error occured closing the file referred to by P. We tell the ++ user and terminate the program. */ ++ ++static void close_error(p) ++ FILE_NODE *p ; ++{ ++ errmsg(errno, "close failed on file %s", p->name->str) ; ++ mawk_exit(2) ; ++} +diff -urNad 01.mawk.tmp/test/full-awk.dat 01.mawk/test/full-awk.dat +--- 01.mawk.tmp/test/full-awk.dat 1970-01-01 01:00:00.000000000 +0100 ++++ 01.mawk/test/full-awk.dat 2003-04-09 22:05:20.000000000 +0100 +@@ -0,0 +1,3 @@ ++This has to be a small file to check if mawk handles write errors correctly ++even on a full disk. It has to be smaller than the write buffer of the ++C library. +diff -urNad 01.mawk.tmp/test/mawktest 01.mawk/test/mawktest +--- 01.mawk.tmp/test/mawktest 1993-07-03 19:58:38.000000000 +0100 ++++ 01.mawk/test/mawktest 2003-04-09 22:05:20.000000000 +0100 +@@ -39,6 +39,17 @@ + ####################################### + + echo ++echo testing checking for write errors ++# Check for write errors noticed when closing the file ++mawk '{print}' /dev/full 2>/dev/null && exit ++# Check for write errors noticed on writing ++# The file has to be bigger than the buffer size of the libc ++mawk '{print}' <../scan.c >/dev/full 2>/dev/null && exit ++ ++echo checking for write errors OK ++####################################### ++ ++echo + echo testing arrays and flow of control + + mawk -f wfrq0.awk $dat | cmp -s - wfrq-awk.out || exit --- mawk-1.3.3.orig/debian/patches/03_read-and-close-redefinition.dpatch +++ mawk-1.3.3/debian/patches/03_read-and-close-redefinition.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh -e +## 03_read-and-close-redefinition.dpatch by LaMont Jones +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Don't prototype read() and close() in mawk.h, #include instead. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 03.mawk.tmp/mawk.h 03.mawk/mawk.h +--- 03.mawk.tmp/mawk.h 1996-11-08 14:54:52.000000000 +0000 ++++ 03.mawk/mawk.h 2003-04-09 22:18:33.000000000 +0100 +@@ -52,6 +52,7 @@ + + #include "nstd.h" + #include ++#include + #include "types.h" + + #ifdef DEBUG +@@ -153,9 +154,6 @@ + int PROTO( binmode, (void)) ; + + +-int PROTO( close, (int) ) ; +-int PROTO( read, (int , PTR, unsigned) ) ; +- + void PROTO ( parse, (void) ) ; + int PROTO ( yylex, (void) ) ; + int PROTO( yyparse, (void) ) ; --- mawk-1.3.3.orig/debian/patches/02_fix-examples.dpatch +++ mawk-1.3.3/debian/patches/02_fix-examples.dpatch @@ -0,0 +1,142 @@ +#! /bin/sh -e +## 02_fix-examples.dpatch by Edward Betts +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix bang paths and echo usage in examples. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 02.mawk.tmp/examples/ct_length.awk 02.mawk/examples/ct_length.awk +--- 02.mawk.tmp/examples/ct_length.awk 1993-07-03 19:58:46.000000000 +0100 ++++ 02.mawk/examples/ct_length.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/mawk -f ++#!/usr/bin/mawk -f + + # ct_length.awk + # +diff -urNad 02.mawk.tmp/examples/decl.awk 02.mawk/examples/decl.awk +--- 02.mawk.tmp/examples/decl.awk 1993-07-03 19:58:44.000000000 +0100 ++++ 02.mawk/examples/decl.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,3 +1,4 @@ ++#!/usr/bin/awk -f + + # parse a C declaration by recursive descent + # based on a C program in KR ANSI edition +@@ -137,7 +138,3 @@ + } + + } +- +- +- +- +diff -urNad 02.mawk.tmp/examples/deps.awk 02.mawk/examples/deps.awk +--- 02.mawk.tmp/examples/deps.awk 1994-02-24 02:54:30.000000000 +0000 ++++ 02.mawk/examples/deps.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,3 +1,4 @@ ++#!/usr/bin/mawk -f + + # find include dependencies in C source + # +diff -urNad 02.mawk.tmp/examples/eatc.awk 02.mawk/examples/eatc.awk +--- 02.mawk.tmp/examples/eatc.awk 1993-07-03 19:58:46.000000000 +0100 ++++ 02.mawk/examples/eatc.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,4 +1,4 @@ +- ++#!/usr/bin/mawk -f + + # eatc.awk + # another program to remove comments +diff -urNad 02.mawk.tmp/examples/gdecl.awk 02.mawk/examples/gdecl.awk +--- 02.mawk.tmp/examples/gdecl.awk 1993-07-03 19:58:45.000000000 +0100 ++++ 02.mawk/examples/gdecl.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,3 +1,4 @@ ++#!/usr/bin/mawk + + # parse a C declaration by recursive descent + # +@@ -130,7 +131,3 @@ + } + + } +- +- +- +- +diff -urNad 02.mawk.tmp/examples/hcal 02.mawk/examples/hcal +--- 02.mawk.tmp/examples/hcal 1996-08-25 19:45:47.000000000 +0100 ++++ 02.mawk/examples/hcal 2003-04-09 22:14:56.000000000 +0100 +@@ -1,4 +1,5 @@ +-#!/usr/local/bin/mawk -We ++#!/usr/bin/mawk -We ++ + # edit the above to be the full pathname of 'mawk' + # @(#) hcal - v01.00.02 - Tue Feb 27 21:21:21 EST 1996 + # @(#) prints a 3-month (highlighted) calendar centered on the target month +@@ -414,5 +415,3 @@ + if ( ! j ) Get_J() + return Get_Num("01/01/0001",m,d,y,j) + } +- +- +diff -urNad 02.mawk.tmp/examples/hical 02.mawk/examples/hical +--- 02.mawk.tmp/examples/hical 1995-06-03 10:37:59.000000000 +0100 ++++ 02.mawk/examples/hical 2003-04-09 22:14:56.000000000 +0100 +@@ -1,4 +1,5 @@ +-: ++#!/usr/sh ++ + # @(#) hical - displays previous, current & next months - today highlighted + # @(#) an "internationalizationable" version of a 3-month 'cal' display, it + # @(#) may be edited for week to start with Sun or Mon & for local language +@@ -19,8 +20,10 @@ + # the 'awk' program file is written to a temporary file to avoid any + # "arg list too long" error messages, yet have all the code in one file + # observe when editing the program file that '\n' must be '\\n' +-# NOTE: for the 'bash' shell on Linux, use 'echo -e' in the next line +-echo '{ ++# NOTE: to make this script portable /bin/echo has been used instead of the ++# echo built into the shell for the 'bash' shell on Linux, use 'echo -e' in ++# the next line (Modification made by Edward Betts ) ++/bin/echo '{ + # USER EDITS MAY BE REQUIRED (for FMT, day & month names, and the time stuff) + # FMT = 0 # for weekdays ordered "Mo Tu We Th Fr Sa Su" + FMT = 1 # for weekdays ordered "Su Mo Tu We Th Fr Sa" +diff -urNad 02.mawk.tmp/examples/nocomment.awk 02.mawk/examples/nocomment.awk +--- 02.mawk.tmp/examples/nocomment.awk 1993-07-03 19:58:45.000000000 +0100 ++++ 02.mawk/examples/nocomment.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,3 +1,4 @@ ++#!/usr/bin/mawk -f + + # remove C comments from a list of files + # using a comment as the record separator +diff -urNad 02.mawk.tmp/examples/primes.awk 02.mawk/examples/primes.awk +--- 02.mawk.tmp/examples/primes.awk 1993-07-03 19:58:46.000000000 +0100 ++++ 02.mawk/examples/primes.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,3 +1,4 @@ ++#!/usr/bin/mawk -f + + # primes.awk + # +diff -urNad 02.mawk.tmp/examples/qsort.awk 02.mawk/examples/qsort.awk +--- 02.mawk.tmp/examples/qsort.awk 1993-07-03 19:58:46.000000000 +0100 ++++ 02.mawk/examples/qsort.awk 2003-04-09 22:14:56.000000000 +0100 +@@ -1,4 +1,4 @@ +- ++#!/usr/bin/mawk -f + + # qsort text files + # --- mawk-1.3.3.orig/debian/patches/06_parse.y-semicolons.dpatch +++ mawk-1.3.3/debian/patches/06_parse.y-semicolons.dpatch @@ -0,0 +1,80 @@ +#! /bin/sh -e +## 06_parse.y-semicolons.dpatch by Paul Eggert +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix missing semicolons in parse.y to keep recent versions of bison happy. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 06.mawk.tmp/parse.y 06.mawk/parse.y +--- 06.mawk.tmp/parse.y 1995-06-11 23:55:31.000000000 +0100 ++++ 06.mawk/parse.y 2003-04-09 22:34:10.000000000 +0100 +@@ -274,6 +274,7 @@ + code1(_PUSHINT) ; code1(0) ; + code2(_PRINT, bi_print) ; + } ++ ; + + statement_list : statement + | statement_list statement +@@ -482,6 +483,7 @@ + /* an empty production to store the code_ptr */ + mark : /* empty */ + { $$ = code_offset ; } ++ ; + + /* print_statement */ + statement : print mark pr_args pr_direction separator +@@ -540,6 +542,7 @@ + { patch_jmp(code_ptr) ; + patch_jmp(CDP($4)) ; + } ++ ; + + + /* LOOPS */ +@@ -883,7 +886,7 @@ + } + } + } +- ++ ; + + + /* exit_statement */ +@@ -892,12 +895,14 @@ + code1(_EXIT0) ; } + | EXIT expr separator + { $$ = $2 ; code1(_EXIT) ; } ++ ; + + return_statement : RETURN separator + { $$ = code_offset ; + code1(_RET0) ; } + | RETURN expr separator + { $$ = $2 ; code1(_RET) ; } ++ ; + + /* getline */ + +@@ -931,7 +936,7 @@ + } + ; + +-getline : GETLINE { getline_flag = 1 ; } ++getline : GETLINE { getline_flag = 1 ; } ; + + fvalue : lvalue | field ; + --- mawk-1.3.3.orig/debian/patches/07_mawktest-check-devfull.dpatch +++ mawk-1.3.3/debian/patches/07_mawktest-check-devfull.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh -e +## 07_mawktest-check-devfull.dpatch by James Troup +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Apparently some systems don't have /dev/full... + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 07.mawk.tmp/test/mawktest 07.mawk/test/mawktest +--- 07.mawk.tmp/test/mawktest 2003-04-10 02:20:24.000000000 +0100 ++++ 07.mawk/test/mawktest 2003-04-10 02:15:46.000000000 +0100 +@@ -39,14 +39,19 @@ + ####################################### + + echo +-echo testing checking for write errors +-# Check for write errors noticed when closing the file +-mawk '{print}' /dev/full 2>/dev/null && exit +-# Check for write errors noticed on writing +-# The file has to be bigger than the buffer size of the libc +-mawk '{print}' <../scan.c >/dev/full 2>/dev/null && exit ++if [ -c /dev/full ]; then ++ echo testing checking for write errors ++ # Check for write errors noticed when closing the file ++ mawk '{print}' /dev/full 2>/dev/null && exit ++ # Check for write errors noticed on writing ++ # The file has to be bigger than the buffer size of the libc ++ mawk '{print}' <../scan.c >/dev/full 2>/dev/null && exit ++ ++ echo checking for write errors OK ++else ++ echo "No /dev/full - check for write errors skipped" ++fi + +-echo checking for write errors OK + ####################################### + + echo --- mawk-1.3.3.orig/debian/patches/05_-Wall-fixes.dpatch +++ mawk-1.3.3/debian/patches/05_-Wall-fixes.dpatch @@ -0,0 +1,865 @@ +#! /bin/sh -e +## 05_-Wall-fixes.dpatch by James Troup +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Partial attempt at making the code -Wall clean. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 05.mawk.tmp/array.c 05.mawk/array.c +--- 05.mawk.tmp/array.c 1996-09-18 02:07:09.000000000 +0100 ++++ 05.mawk/array.c 2003-04-09 22:26:26.000000000 +0100 +@@ -112,8 +112,10 @@ + Int ival = d_to_I(d) ; + if ((double)ival == d) { + if (A->type == AY_SPLIT) ++ { + if (ival >=1 && ival <= A->size) convert_split_array_to_table(A) ; + else return ; /* ival not in range */ ++ } + ap = find_by_ival(A, ival, NO_CREATE) ; + if (ap) { /* remove from the front of the ilist */ + DUAL_LINK *table = (DUAL_LINK*) A->ptr ; +diff -urNad 05.mawk.tmp/bi_funct.c 05.mawk/bi_funct.c +--- 05.mawk.tmp/bi_funct.c 1996-01-14 17:16:11.000000000 +0000 ++++ 05.mawk/bi_funct.c 2003-04-09 22:26:26.000000000 +0100 +@@ -74,37 +74,36 @@ + #include "regexp.h" + #include "repl.h" + #include +- ++#include + + /* statics */ + static STRING *PROTO(gsub, (PTR, CELL *, char *, int)) ; + static void PROTO(fplib_err, (char *, double, char *)) ; + +- + /* global for the disassembler */ + BI_REC bi_funct[] = + { /* info to load builtins */ + +- "length", bi_length, 0, 1, /* special must come first */ +- "index", bi_index, 2, 2, +- "substr", bi_substr, 2, 3, +- "sprintf", bi_sprintf, 1, 255, +- "sin", bi_sin, 1, 1, +- "cos", bi_cos, 1, 1, +- "atan2", bi_atan2, 2, 2, +- "exp", bi_exp, 1, 1, +- "log", bi_log, 1, 1, +- "int", bi_int, 1, 1, +- "sqrt", bi_sqrt, 1, 1, +- "rand", bi_rand, 0, 0, +- "srand", bi_srand, 0, 1, +- "close", bi_close, 1, 1, +- "system", bi_system, 1, 1, +- "toupper", bi_toupper, 1, 1, +- "tolower", bi_tolower, 1, 1, +- "fflush", bi_fflush, 0, 1, ++ {"length", bi_length, 0, 1}, /* special must come first */ ++ {"index", bi_index, 2, 2}, ++ {"substr", bi_substr, 2, 3}, ++ {"sprintf", bi_sprintf, 1, 255}, ++ {"sin", bi_sin, 1, 1}, ++ {"cos", bi_cos, 1, 1}, ++ {"atan2", bi_atan2, 2, 2}, ++ {"exp", bi_exp, 1, 1}, ++ {"log", bi_log, 1, 1}, ++ {"int", bi_int, 1, 1}, ++ {"sqrt", bi_sqrt, 1, 1}, ++ {"rand", bi_rand, 0, 0}, ++ {"srand", bi_srand, 0, 1}, ++ {"close", bi_close, 1, 1}, ++ {"system", bi_system, 1, 1}, ++ {"toupper", bi_toupper, 1, 1}, ++ {"tolower", bi_tolower, 1, 1}, ++ {"fflush", bi_fflush, 0, 1}, + +- (char *) 0, (PF_CP) 0, 0, 0} ; ++ {(char *) 0, (PF_CP) 0, 0, 0}} ; + + + /* load built-in functions in symbol table */ +@@ -175,7 +174,7 @@ + case 2: + { + int k1 = key[1] ; +- while (target = strchr(target, k)) ++ while ((target = strchr(target, k))) + if (target[1] == k1) return target ; + else target++ ; + /*failed*/ +@@ -184,7 +183,7 @@ + } + + key_len-- ; +- while (target = strchr(target, k)) ++ while ((target = strchr(target, k))) + { + if (strncmp(target + 1, key + 1, key_len) == 0) return target ; + else target++ ; +@@ -206,7 +205,7 @@ + sp-- ; + if (TEST2(sp) != TWO_STRINGS) cast2_to_s(sp) ; + +- if (len = string(sp + 1)->len) ++ if ((len = string(sp + 1)->len)) + idx = (p = str_str(string(sp)->str, string(sp + 1)->str, len)) + ? p - string(sp)->str + 1 : 0 ; + +@@ -240,7 +239,7 @@ + + if ((len = sval->len) == 0) /* substr on null string */ + { +- if (n_args == 3) cell_destroy(sp + 2) ; ++ if (n_args == 3) { cell_destroy(sp + 2) ; } + cell_destroy(sp + 1) ; + return sp ; + } +@@ -831,7 +830,7 @@ + if (sc.type < C_STRING) cast1_to_s(&sc) ; + front = string(&sc)->str ; + +- if (middle = REmatch(front, sp->ptr, &middle_len)) ++ if ((middle = REmatch(front, sp->ptr, &middle_len))) + { + front_len = middle - front ; + back = middle + middle_len ; +diff -urNad 05.mawk.tmp/da.c 05.mawk/da.c +--- 05.mawk.tmp/da.c 1995-06-18 20:19:59.000000000 +0100 ++++ 05.mawk/da.c 2003-04-09 22:26:26.000000000 +0100 +@@ -68,65 +68,65 @@ + } simple_code[] = + + { +- _STOP, "stop", +- FE_PUSHA, "fe_pusha", +- FE_PUSHI, "fe_pushi", +- A_TEST, "a_test", +- A_DEL, "a_del", +- DEL_A, "del_a", +- POP_AL, "pop_al", +- _POP, "pop", +- _ADD, "add", +- _SUB, "sub", +- _MUL, "mul", +- _DIV, "div", +- _MOD, "mod", +- _POW, "pow", +- _NOT, "not", +- _UMINUS, "uminus", +- _UPLUS, "uplus", +- _TEST, "test", +- _CAT, "cat", +- _ASSIGN, "assign", +- _ADD_ASG, "add_asg", +- _SUB_ASG, "sub_asg", +- _MUL_ASG, "mul_asg", +- _DIV_ASG, "div_asg", +- _MOD_ASG, "mod_asg", +- _POW_ASG, "pow_asg", +- NF_PUSHI, "nf_pushi", +- F_ASSIGN, "f_assign", +- F_ADD_ASG, "f_add_asg", +- F_SUB_ASG, "f_sub_asg", +- F_MUL_ASG, "f_mul_asg", +- F_DIV_ASG, "f_div_asg", +- F_MOD_ASG, "f_mod_asg", +- F_POW_ASG, "f_pow_asg", +- _POST_INC, "post_inc", +- _POST_DEC, "post_dec", +- _PRE_INC, "pre_inc", +- _PRE_DEC, "pre_dec", +- F_POST_INC, "f_post_inc", +- F_POST_DEC, "f_post_dec", +- F_PRE_INC, "f_pre_inc", +- F_PRE_DEC, "f_pre_dec", +- _EQ, "eq", +- _NEQ, "neq", +- _LT, "lt", +- _LTE, "lte", +- _GT, "gt", +- _GTE, "gte", +- _MATCH2, "match2", +- _EXIT, "exit", +- _EXIT0, "exit0", +- _NEXT, "next", +- _RET, "ret", +- _RET0, "ret0", +- _OMAIN, "omain", +- _JMAIN, "jmain", +- OL_GL, "ol_gl", +- OL_GL_NR, "ol_gl_nr", +- _HALT, (char *) 0 ++ {_STOP, "stop"}, ++ {FE_PUSHA, "fe_pusha"}, ++ {FE_PUSHI, "fe_pushi"}, ++ {A_TEST, "a_test"}, ++ {A_DEL, "a_del"}, ++ {DEL_A, "del_a"}, ++ {POP_AL, "pop_al"}, ++ {_POP, "pop"}, ++ {_ADD, "add"}, ++ {_SUB, "sub"}, ++ {_MUL, "mul"}, ++ {_DIV, "div"}, ++ {_MOD, "mod"}, ++ {_POW, "pow"}, ++ {_NOT, "not"}, ++ {_UMINUS, "uminus"}, ++ {_UPLUS, "uplus"}, ++ {_TEST, "test"}, ++ {_CAT, "cat"}, ++ {_ASSIGN, "assign"}, ++ {_ADD_ASG, "add_asg"}, ++ {_SUB_ASG, "sub_asg"}, ++ {_MUL_ASG, "mul_asg"}, ++ {_DIV_ASG, "div_asg"}, ++ {_MOD_ASG, "mod_asg"}, ++ {_POW_ASG, "pow_asg"}, ++ {NF_PUSHI, "nf_pushi"}, ++ {F_ASSIGN, "f_assign"}, ++ {F_ADD_ASG, "f_add_asg"}, ++ {F_SUB_ASG, "f_sub_asg"}, ++ {F_MUL_ASG, "f_mul_asg"}, ++ {F_DIV_ASG, "f_div_asg"}, ++ {F_MOD_ASG, "f_mod_asg"}, ++ {F_POW_ASG, "f_pow_asg"}, ++ {_POST_INC, "post_inc"}, ++ {_POST_DEC, "post_dec"}, ++ {_PRE_INC, "pre_inc"}, ++ {_PRE_DEC, "pre_dec"}, ++ {F_POST_INC, "f_post_inc"}, ++ {F_POST_DEC, "f_post_dec"}, ++ {F_PRE_INC, "f_pre_inc"}, ++ {F_PRE_DEC, "f_pre_dec"}, ++ {_EQ, "eq"}, ++ {_NEQ, "neq"}, ++ {_LT, "lt"}, ++ {_LTE, "lte"}, ++ {_GT, "gt"}, ++ {_GTE, "gte"}, ++ {_MATCH2, "match2"}, ++ {_EXIT, "exit"}, ++ {_EXIT0, "exit0"}, ++ {_NEXT, "next"}, ++ {_RET, "ret"}, ++ {_RET0, "ret0"}, ++ {_OMAIN, "omain"}, ++ {_JMAIN, "jmain"}, ++ {OL_GL, "ol_gl"}, ++ {OL_GL_NR, "ol_gl_nr"}, ++ {_HALT, (char *) 0} + } ; + + static char *jfmt = "%s%s%03d\n" ; +@@ -367,12 +367,12 @@ + } + special_cases[] = + { +- bi_split, "split", +- bi_match, "match", +- bi_getline, "getline", +- bi_sub, "sub", +- bi_gsub, "gsub", +- (PF_CP) 0, (char *) 0 ++ {bi_split, "split"}, ++ {bi_match, "match"}, ++ {bi_getline, "getline"}, ++ {bi_sub, "sub"}, ++ {bi_gsub, "gsub"}, ++ {(PF_CP) 0, (char *) 0} + } ; + + static char * +diff -urNad 05.mawk.tmp/error.c 05.mawk/error.c +--- 05.mawk.tmp/error.c 1995-06-06 01:18:22.000000000 +0100 ++++ 05.mawk/error.c 2003-04-09 22:26:26.000000000 +0100 +@@ -68,54 +68,54 @@ + static struct token_str { + short token ; + char *str ; } token_str[] = { +-EOF , "end of file" , +-NL , "end of line", +-SEMI_COLON , ";" , +-LBRACE , "{" , +-RBRACE , "}" , +-SC_FAKE_SEMI_COLON, "}", +-LPAREN , "(" , +-RPAREN , ")" , +-LBOX , "[", +-RBOX , "]", +-QMARK , "?", +-COLON , ":", +-OR, "||", +-AND, "&&", +-ASSIGN , "=" , +-ADD_ASG, "+=", +-SUB_ASG, "-=", +-MUL_ASG, "*=", +-DIV_ASG, "/=", +-MOD_ASG, "%=", +-POW_ASG, "^=", +-EQ , "==" , +-NEQ , "!=", +-LT, "<" , +-LTE, "<=" , +-GT, ">", +-GTE, ">=" , +-MATCH, string_buff, +-PLUS , "+" , +-MINUS, "-" , +-MUL , "*" , +-DIV, "/" , +-MOD, "%" , +-POW, "^" , +-NOT, "!" , +-COMMA, "," , +-INC_or_DEC , string_buff , +-DOUBLE , string_buff , +-STRING_ , string_buff , +-ID , string_buff , +-FUNCT_ID , string_buff , +-BUILTIN , string_buff , +-IO_OUT , string_buff , +-IO_IN, "<" , +-PIPE, "|" , +-DOLLAR, "$" , +-FIELD, "$" , +-0, (char *) 0 } ; ++{EOF , "end of file" }, ++{NL , "end of line"}, ++{SEMI_COLON , ";" }, ++{LBRACE , "{" }, ++{RBRACE , "}" }, ++{SC_FAKE_SEMI_COLON, "}"}, ++{LPAREN , "(" }, ++{RPAREN , ")" }, ++{LBOX , "["}, ++{RBOX , "]"}, ++{QMARK , "?"}, ++{COLON , ":"}, ++{OR, "||"}, ++{AND, "&&"}, ++{ASSIGN , "=" }, ++{ADD_ASG, "+="}, ++{SUB_ASG, "-="}, ++{MUL_ASG, "*="}, ++{DIV_ASG, "/="}, ++{MOD_ASG, "%="}, ++{POW_ASG, "^="}, ++{EQ , "==" }, ++{NEQ , "!="}, ++{LT, "<" }, ++{LTE, "<=" }, ++{GT, ">"}, ++{GTE, ">=" }, ++{MATCH, string_buff}, ++{PLUS , "+" }, ++{MINUS, "-" }, ++{MUL , "*" }, ++{DIV, "/" }, ++{MOD, "%" }, ++{POW, "^" }, ++{NOT, "!" }, ++{COMMA, "," }, ++{INC_or_DEC , string_buff }, ++{DOUBLE , string_buff }, ++{STRING_ , string_buff }, ++{ID , string_buff }, ++{FUNCT_ID , string_buff }, ++{BUILTIN , string_buff }, ++{IO_OUT , string_buff }, ++{IO_IN, "<" }, ++{PIPE, "|" }, ++{DOLLAR, "$" }, ++{FIELD, "$" }, ++{0, (char *) 0 }} ; + + /* if paren_cnt >0 and we see one of these, we are missing a ')' */ + static int missing_rparen[] = +diff -urNad 05.mawk.tmp/fcall.c 05.mawk/fcall.c +--- 05.mawk.tmp/fcall.c 1995-08-27 16:46:47.000000000 +0100 ++++ 05.mawk/fcall.c 2003-04-09 22:26:26.000000000 +0100 +@@ -86,7 +86,7 @@ + take q off entry_list + test it + if OK zfree(q) else put on exit_list */ +- while (q = entry_list) ++ while ((q = entry_list)) + { + entry_list = q->link ; + +@@ -235,8 +235,8 @@ + } + /* note p->arg_list starts with last argument */ + else if (!p->arg_list /* nothing to do */ || +- !p->arg_cnt_checked && +- !arg_cnt_ok(p->callee, p->arg_list, p->line_no)) ++ (!p->arg_cnt_checked && ++ !arg_cnt_ok(p->callee, p->arg_list, p->line_no))) + { + q->link = p->link ; /* delete p */ + /* the ! arg_list case is not an error so free memory */ +@@ -301,8 +301,8 @@ + p = old_list ; + old_list = p->link ; + +- if (p->arg_list = call_arg_check(p->callee, p->arg_list, +- p->call_start, p->line_no)) ++ if ((p->arg_list = call_arg_check(p->callee, p->arg_list, ++ p->call_start, p->line_no))) + { + /* still have work to do , put on new_list */ + progress |= check_progress ; +@@ -352,8 +352,8 @@ + /* usually arg_list disappears here and all is well + otherwise add to resolve list */ + +- if (arg_list = call_arg_check(callee, arg_list, +- code_base, line_no)) ++ if ((arg_list = call_arg_check(callee, arg_list, ++ code_base, line_no))) + { + p = ZMALLOC(FCALL_REC) ; + p->callee = callee ; +diff -urNad 05.mawk.tmp/field.c 05.mawk/field.c +--- 05.mawk.tmp/field.c 1995-06-18 20:17:47.000000000 +0100 ++++ 05.mawk/field.c 2003-04-09 22:26:26.000000000 +0100 +@@ -109,13 +109,15 @@ + scan_code['\n'] = SC_UNEXPECTED ; + + if (rs_shadow.type == SEP_STR) +- free_STRING((STRING *) rs_shadow.ptr) ; ++ { ++ free_STRING((STRING *) rs_shadow.ptr) ; ++ } + + cast_for_split(cellcpy(&c, RS)) ; + switch (c.type) + { + case C_RE: +- if (s = is_string_split(c.ptr, &len)) ++ if ((s = is_string_split(c.ptr, &len))) + { + if (len == 1) + { +@@ -276,7 +278,7 @@ + field[cnt--].type = C_MBSTRN ; + } + +- if (cp == &c) free_STRING(string(cp)) ; ++ if (cp == &c) { free_STRING(string(cp)) ; } + } + + /* +@@ -503,7 +505,7 @@ + memcpy(p, string(cp)->str, string(cp)->len) ; + p += string(cp)->len ; + /* if not really string, free temp use of ptr */ +- if (cp->type < C_STRING) free_STRING(string(cp)) ; ++ if (cp->type < C_STRING) { free_STRING(string(cp)) ; } + if (++cp == cp_limit) + { + cp = *++fbp ; +diff -urNad 05.mawk.tmp/files.c 05.mawk/files.c +--- 05.mawk.tmp/files.c 2003-04-09 22:27:02.000000000 +0100 ++++ 05.mawk/files.c 2003-04-09 22:26:26.000000000 +0100 +@@ -61,6 +61,9 @@ + #include "memory.h" + #include "fin.h" + ++#include ++#include ++#include + + #ifdef V7 + #include /* defines FIOCLEX */ +@@ -188,7 +191,7 @@ + if (strcmp(name, p->name->str) == 0 && + (p->type == type || + /* no distinction between F_APPEND and F_TRUNC here */ +- p->type >= F_APPEND && type >= F_APPEND)) ++ (p->type >= F_APPEND && type >= F_APPEND))) + + { + /* found */ +@@ -550,7 +553,7 @@ + add_to_child_list(id, exit_status) ; + } + /* see if an earlier wait() caught our child */ +- else if (p = remove_from_child_list(pid)) ++ else if ((p = remove_from_child_list(pid))) + { + exit_status = p->exit_status ; + ZFREE(p) ; +diff -urNad 05.mawk.tmp/fin.c 05.mawk/fin.c +--- 05.mawk.tmp/fin.c 1995-12-24 22:23:22.000000000 +0000 ++++ 05.mawk/fin.c 2003-04-09 22:26:26.000000000 +0100 +@@ -108,8 +108,8 @@ + fin->nbuffs = 1 ; + fin->buff[0] = 0 ; + +- if (isatty(fd) && rs_shadow.type == SEP_CHAR && rs_shadow.c == '\n' +- || interactive_flag && fd == 0 ) ++ if ((isatty(fd) && rs_shadow.type == SEP_CHAR && rs_shadow.c == '\n') ++ || (interactive_flag && fd == 0) ) + { + /* interactive, i.e., line buffer this file */ + if (fd == 0) fin->fp = stdin ; +@@ -169,8 +169,10 @@ + zfree(fin->buff, fin->nbuffs * BUFFSZ + 1) ; + + if (fin->fd) ++ { + if (fin->fp) fclose(fin->fp) ; + else close(fin->fd) ; ++ } + + fin->buff = fin->buffp = &dead ; /* marks it semi_closed */ + } +diff -urNad 05.mawk.tmp/init.c 05.mawk/init.c +--- 05.mawk.tmp/init.c 1995-08-20 18:35:21.000000000 +0100 ++++ 05.mawk/init.c 2003-04-09 22:26:26.000000000 +0100 +@@ -69,6 +69,7 @@ + #include "init.h" + #include "bi_vars.h" + #include "field.h" ++#include + + #ifdef MSDOS + #include +@@ -370,7 +371,7 @@ + + while (*p) + { +- if (s = strchr(*p, '=')) /* shouldn't fail */ ++ if ((s = strchr(*p, '='))) /* shouldn't fail */ + { + int len = s - *p ; + c.ptr = (PTR) new_STRING0(len) ; +diff -urNad 05.mawk.tmp/kw.c 05.mawk/kw.c +--- 05.mawk.tmp/kw.c 1993-07-17 14:22:59.000000000 +0100 ++++ 05.mawk/kw.c 2003-04-09 22:26:26.000000000 +0100 +@@ -41,29 +41,29 @@ + keywords[] = + { + +- "print", PRINT, +- "printf", PRINTF, +- "do", DO, +- "while", WHILE, +- "for", FOR, +- "break", BREAK, +- "continue", CONTINUE, +- "if", IF, +- "else", ELSE, +- "in", IN, +- "delete", DELETE, +- "split", SPLIT, +- "match", MATCH_FUNC, +- "BEGIN", BEGIN, +- "END", END, +- "exit", EXIT, +- "next", NEXT, +- "return", RETURN, +- "getline", GETLINE, +- "sub", SUB, +- "gsub", GSUB, +- "function", FUNCTION, +- (char *) 0, 0 ++ {"print", PRINT}, ++ {"printf", PRINTF}, ++ {"do", DO}, ++ {"while", WHILE}, ++ {"for", FOR}, ++ {"break", BREAK}, ++ {"continue", CONTINUE}, ++ {"if", IF}, ++ {"else", ELSE}, ++ {"in", IN}, ++ {"delete", DELETE}, ++ {"split", SPLIT}, ++ {"match", MATCH_FUNC}, ++ {"BEGIN", BEGIN}, ++ {"END", END}, ++ {"exit", EXIT}, ++ {"next", NEXT}, ++ {"return", RETURN}, ++ {"getline", GETLINE}, ++ {"sub", SUB}, ++ {"gsub", GSUB}, ++ {"function", FUNCTION}, ++ {(char *) 0, 0} + } ; + + /* put keywords in the symbol table */ +diff -urNad 05.mawk.tmp/mawk.h 05.mawk/mawk.h +--- 05.mawk.tmp/mawk.h 2003-04-09 22:27:02.000000000 +0100 ++++ 05.mawk/mawk.h 2003-04-09 22:26:26.000000000 +0100 +@@ -146,7 +146,7 @@ + void PROTO( overflow, (char *, unsigned) ) ; + void PROTO( rt_overflow, (char *, unsigned) ) ; + void PROTO( rt_error, ( char *, ...) ) ; +-void PROTO( mawk_exit, (int) ) ; ++void PROTO( mawk_exit, (int) ) __attribute__ ((noreturn)) ; + void PROTO( da, (INST *, FILE *)) ; + char *PROTO( str_str, (char*, char*, unsigned) ) ; + char *PROTO( rm_escape, (char *) ) ; +@@ -160,7 +160,7 @@ + void PROTO( yyerror, (char *) ) ; + void PROTO( scan_cleanup, (void)) ; + +-void PROTO( bozo, (char *) ) ; ++void PROTO( bozo, (char *) ) __attribute__ ((noreturn)); + void PROTO( errmsg , (int, char*, ...) ) ; + void PROTO( compile_error, ( char *, ...) ) ; + +diff -urNad 05.mawk.tmp/re_cmpl.c 05.mawk/re_cmpl.c +--- 05.mawk.tmp/re_cmpl.c 1994-12-13 00:14:58.000000000 +0000 ++++ 05.mawk/re_cmpl.c 2003-04-09 22:26:26.000000000 +0100 +@@ -138,6 +138,8 @@ + if (p->re == m) return p->sval->str ; + #ifdef DEBUG + bozo("non compiled machine") ; ++#else ++ return NULL; + #endif + } + +@@ -240,7 +242,7 @@ + p = (STRING **) cp->ptr ; + for (cnt = cp->vcnt; cnt; cnt--) + { +- if (*p) free_STRING(*p) ; ++ if (*p) { free_STRING(*p) ; } + p++ ; + } + zfree(cp->ptr, cp->vcnt * sizeof(STRING *)) ; +@@ -365,6 +367,8 @@ + + #if DEBUG + bozo("unable to uncompile an repl") ; ++#else ++ return NULL; + #endif + } + +diff -urNad 05.mawk.tmp/rexp/rexp.c 05.mawk/rexp/rexp.c +--- 05.mawk.tmp/rexp/rexp.c 1996-09-02 19:47:36.000000000 +0100 ++++ 05.mawk/rexp/rexp.c 2003-04-09 22:26:26.000000000 +0100 +@@ -65,14 +65,14 @@ + static short table[8][8] = { + + /* 0 | CAT * + ? ( ) */ +-/* 0 */ 0, L, L, L, L, L, L, E1, +-/* | */ G, G, L, L, L, L, L, G, +-/* CAT*/ G, G, G, L, L, L, L, G, +-/* * */ G, G, G, G, G, G, E7, G, +-/* + */ G, G, G, G, G, G, E7, G, +-/* ? */ G, G, G, G, G, G, E7, G, +-/* ( */ E2, L, L, L, L, L, L, EQ, +-/* ) */ G , G, G, G, G, G, E7, G } ; ++/* 0 */ {0, L, L, L, L, L, L, E1}, ++/* | */ {G, G, L, L, L, L, L, G}, ++/* CAT*/ {G, G, G, L, L, L, L, G}, ++/* * */ {G, G, G, G, G, G, E7, G}, ++/* + */ {G, G, G, G, G, G, E7, G}, ++/* ? */ {G, G, G, G, G, G, E7, G}, ++/* ( */ {E2, L, L, L, L, L, L, EQ}, ++/* ) */ {G , G, G, G, G, G, E7, G} } ; + + + #define STACKSZ 64 +diff -urNad 05.mawk.tmp/rexp/rexp.h 05.mawk/rexp/rexp.h +--- 05.mawk.tmp/rexp/rexp.h 1993-07-23 14:21:35.000000000 +0100 ++++ 05.mawk/rexp/rexp.h 2003-04-09 22:26:26.000000000 +0100 +@@ -152,7 +152,7 @@ + void PROTO( RE_close, (MACHINE *) ) ; + void PROTO( RE_poscl, (MACHINE *) ) ; + void PROTO( RE_01, (MACHINE *) ) ; +-void PROTO( RE_panic, (char *) ) ; ++void PROTO( RE_panic, (char *) ) __attribute__((noreturn)) ; + char *PROTO( str_str, (char *, char *, unsigned) ) ; + + void PROTO( RE_lex_init , (char *) ) ; +diff -urNad 05.mawk.tmp/rexp/rexp0.c 05.mawk/rexp/rexp0.c +--- 05.mawk.tmp/rexp/rexp0.c 1996-11-08 15:39:27.000000000 +0000 ++++ 05.mawk/rexp/rexp0.c 2003-04-09 22:26:26.000000000 +0100 +@@ -113,7 +113,6 @@ + { + register int c ; + +-reswitch: + switch (c = char2token(*lp)) + { + case T_PLUS: +@@ -165,7 +164,7 @@ + { + case T_ANY: + { +- static plus_is_star_flag = 0 ; ++ static int plus_is_star_flag = 0 ; + + if (*++lp == '*') + { +@@ -560,14 +559,14 @@ + } + escape_test[ET_END + 1] = + { +- 'n', '\n', +- 't', '\t', +- 'f', '\f', +- 'b', '\b', +- 'r', '\r', +- 'a', '\07', +- 'v', '\013', +- 0, 0 ++ {'n', '\n'}, ++ {'t', '\t'}, ++ {'f', '\f'}, ++ {'b', '\b'}, ++ {'r', '\r'}, ++ {'a', '\07'}, ++ {'v', '\013'}, ++ {0, 0} + } ; + + +diff -urNad 05.mawk.tmp/rexp/rexp3.c 05.mawk/rexp/rexp3.c +--- 05.mawk.tmp/rexp/rexp3.c 1993-07-24 18:55:15.000000000 +0100 ++++ 05.mawk/rexp/rexp3.c 2003-04-09 22:26:26.000000000 +0100 +@@ -89,7 +89,7 @@ + /* check for the easy case */ + if ((m + 1)->type == M_ACCEPT && m->type == M_STR) + { +- if (ts = str_str(s, m->data.str, m->len)) *lenp = m->len ; ++ if ((ts = str_str(s, m->data.str, m->len))) *lenp = m->len ; + return ts ; + } + +@@ -315,7 +315,7 @@ + + case M_ACCEPT + U_OFF: + if (!ss) ss = s ; +- if (!cb_ss || ss < cb_ss || ss == cb_ss && s > cb_e) ++ if (!cb_ss || ss < cb_ss || (ss == cb_ss && s > cb_e)) + { + /* we have a new current best */ + cb_ss = ss ; cb_e = s ; +@@ -326,7 +326,7 @@ + if (!ss) ss = s ; + else s = str_end ? str_end : (str_end = s + strlen(s)) ; + +- if (!cb_ss || ss < cb_ss || ss == cb_ss && s > cb_e) ++ if (!cb_ss || ss < cb_ss || (ss == cb_ss && s > cb_e)) + { + /* we have a new current best */ + cb_ss = ss ; cb_e = s ; +diff -urNad 05.mawk.tmp/scan.c 05.mawk/scan.c +--- 05.mawk.tmp/scan.c 1996-07-28 22:47:05.000000000 +0100 ++++ 05.mawk/scan.c 2003-04-09 22:26:26.000000000 +0100 +@@ -420,7 +420,7 @@ + { + if (*p == current_token) + { +- if (*p != INC_or_DEC) test1_ret('=', DIV_ASG, DIV) ; ++ if (*p != INC_or_DEC) { test1_ret('=', DIV_ASG, DIV) ; } + + if (next() == '=') + { +@@ -852,7 +852,7 @@ + #define hex_value(x) hex_val[(x)-'A'] + + #define ishex(x) (scan_code[x] == SC_DIGIT ||\ +- 'A' <= (x) && (x) <= 'f' && hex_value(x)) ++ ('A' <= (x) && (x) <= 'f' && hex_value(x))) + + static int PROTO(octal, (char **)) ; + static int PROTO(hex, (char **)) ; +@@ -909,16 +909,16 @@ + } + escape_test[ET_END + 1] = + { +- 'n', '\n', +- 't', '\t', +- 'f', '\f', +- 'b', '\b', +- 'r', '\r', +- 'a', '\07', +- 'v', '\013', +- '\\', '\\', +- '\"', '\"', +- 0, 0 ++ {'n', '\n'}, ++ {'t', '\t'}, ++ {'f', '\f'}, ++ {'b', '\b'}, ++ {'r', '\r'}, ++ {'a', '\07'}, ++ {'v', '\013'}, ++ {'\\', '\\'}, ++ {'\"', '\"'}, ++ {0, 0} + } ; + + +diff -urNad 05.mawk.tmp/split.c 05.mawk/split.c +--- 05.mawk.tmp/split.c 1996-02-01 05:05:43.000000000 +0000 ++++ 05.mawk/split.c 2003-04-09 22:26:26.000000000 +0100 +@@ -164,7 +164,7 @@ + register char *s ; + PTR re ; unsigned *lenp ; + { +- while (s = REmatch(s, re, lenp)) ++ while ((s = REmatch(s, re, lenp))) + if (*lenp) return s ; + else if (*s == 0) break ; + else s++ ; +@@ -225,7 +225,7 @@ + char *t ; + unsigned len, mlen ; + +- while (t = re_pos_match(s, re, &mlen)) ++ while ((t = re_pos_match(s, re, &mlen))) + { + tail = tail->link = ZMALLOC(SPLIT_OV) ; + tail->sval = new_STRING0(len = t - s) ; +diff -urNad 05.mawk.tmp/version.c 05.mawk/version.c +--- 05.mawk.tmp/version.c 1996-07-28 22:47:07.000000000 +0100 ++++ 05.mawk/version.c 2003-04-09 22:26:26.000000000 +0100 +@@ -46,6 +46,9 @@ + #define DOS_STRING "" + #endif + ++int print_compiler_id(); ++int print_aux_limits(); ++ + static char fmt[] = "%-14s%10lu\n" ; + + /* print VERSION and exit */ +diff -urNad 05.mawk.tmp/zmalloc.c 05.mawk/zmalloc.c +--- 05.mawk.tmp/zmalloc.c 1995-06-06 01:18:35.000000000 +0100 ++++ 05.mawk/zmalloc.c 2003-04-09 22:26:26.000000000 +0100 +@@ -115,7 +115,7 @@ + return (PTR) p ; + } + +- if (p = pool[blocks - 1]) ++ if ((p = pool[blocks - 1])) + { + pool[blocks - 1] = p->link ; + return (PTR) p ; --- mawk-1.3.3.orig/debian/patches/08_fix-for-gcc3.3.dpatch +++ mawk-1.3.3/debian/patches/08_fix-for-gcc3.3.dpatch @@ -0,0 +1,47 @@ +#!/bin/sh -e +## 08_fix-for-gcc3.3.dpatch.dpatch by James Troup +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Gross hack to work-around gcc-3.3 including a builtin log() +## DP: function which broken the configure script. This should definitely +## DP: be fixed better but current autoconf/m4 chokes on mawk.ac.m4. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +@DPATCH@ +diff -urNad /home/james/debian/packages/mawk/mawk-1.3.3/configure mawk-1.3.3/configure +--- /home/james/debian/packages/mawk/mawk-1.3.3/configure 1996-09-05 00:43:01.000000000 +0100 ++++ mawk-1.3.3/configure 2003-05-30 14:43:18.000000000 +0100 +@@ -532,6 +532,8 @@ + log() + ; return 0; } + EOF ++XCFLAGS=$CFLAGS ++CFLAGS="-fno-builtin $CFLAGS" + if eval $ac_link; then + rm -rf conftest* + eval "ac_cv_lib_m=yes" +@@ -540,6 +542,7 @@ + eval "ac_cv_lib_m=no" + fi + rm -f conftest* ++CFLAGS=$XCFLAGS + LIBS="$ac_save_LIBS" + + fi --- mawk-1.3.3.orig/debian/patches/04_mawk.1-fix-pi.dpatch +++ mawk-1.3.3/debian/patches/04_mawk.1-fix-pi.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 04_mawk.1-fix-pi.dpatch by Colin Watson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Display PI as "pi" rather than 'n' in mawk(1) when rendered by nroff. + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch -f --no-backup-if-mismatch -p1 < $0;; + -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1;; +esac + +exit 0 + +diff -urNad 04.mawk.tmp/man/mawk.1 04.mawk/man/mawk.1 +--- 04.mawk.tmp/man/mawk.1 1996-07-28 23:06:16.000000000 +0100 ++++ 04.mawk/man/mawk.1 2003-04-09 22:21:29.000000000 +0100 +@@ -816,7 +816,11 @@ + .RS + .PP + .nf +-atan2(\fIy,x\fR) Arctan of \fIy\fR/\fIx\fR between -\(*p and \(*p. ++.ie n \ ++.ds Pi pi ++.el \ ++.ds Pi \\(*p ++atan2(\fIy,x\fR) Arctan of \fIy\fR/\fIx\fR between -\*(Pi and \*(Pi. + .PP + cos(\fIx\fR) Cosine function, \fIx\fR in radians. + .PP --- mawk-1.3.3.orig/debian/patches/21_memcpy-to-memmove.dpatch +++ mawk-1.3.3/debian/patches/21_memcpy-to-memmove.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 21_memcpy-to-memmove.dpatch by Bryce Harrington +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix bug 955791 + +@DPATCH@ + +--- a/fin.c 2003-05-30 15:24:50 +0000 ++++ b/fin.c 2012-03-17 20:25:21 +0000 +@@ -326,7 +326,7 @@ + /* move a partial line to front of buffer and try again */ + unsigned rr ; + +- p = (char *) memcpy(fin->buff, p, r = strlen(p)) ; ++ p = (char *) memmove(fin->buff, p, r = strlen(p)) ; + q = p+r ; rr = fin->nbuffs*BUFFSZ - r ; + + if ((r = fillbuff(fin->fd, q, rr)) < rr) + --- mawk-1.3.3.orig/test/1 +++ mawk-1.3.3/test/1 @@ -0,0 +1,3 @@ +compiled limits: +max NF 32767 +sprintf buffer 1020