diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-11 00:56:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-11 00:56:51 +0000 |
commit | d17f8d76dd57e6685d172c9ba3dd011aaa93b033 (patch) | |
tree | 59538c95ddfcb77abe180a1551e845569ad656bd | |
parent | old (diff) | |
download | gentoo-2-d17f8d76dd57e6685d172c9ba3dd011aaa93b033.tar.gz gentoo-2-d17f8d76dd57e6685d172c9ba3dd011aaa93b033.tar.bz2 gentoo-2-d17f8d76dd57e6685d172c9ba3dd011aaa93b033.zip |
old
(Portage version: 2.2_rc23/cvs/Linux x86_64)
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-autotools-crap.patch | 438 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-binmode.patch | 20 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-core.patch | 36 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch | 35 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch | 257 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-gcc4.patch | 23 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-internal.patch | 204 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-ipv6.patch | 301 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-mbread.patch | 41 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-num2str.patch | 42 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-numflags.patch | 16 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-syntaxerror.patch | 17 | ||||
-rw-r--r-- | sys-apps/gawk/files/gawk-3.1.5-wconcat.patch | 16 | ||||
-rw-r--r-- | sys-apps/gawk/gawk-3.1.5-r5.ebuild | 124 |
14 files changed, 0 insertions, 1570 deletions
diff --git a/sys-apps/gawk/files/gawk-3.1.5-autotools-crap.patch b/sys-apps/gawk/files/gawk-3.1.5-autotools-crap.patch deleted file mode 100644 index f9ca4de3da83..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-autotools-crap.patch +++ /dev/null @@ -1,438 +0,0 @@ -http://bugs.gentoo.org/139397 - -configure.ac had this crap added to it: - - AC_C_INLINE - AC_C_STRINGIZE - -+dnl misc hacks to make sure all defines are set -+dnl http://bugs.gentoo.org/139397 -+AM_LANGINFO_CODESET -+AC_CHECK_HEADERS([langinfo.h]) -+AC_CHECK_FUNCS([isblank]) -+gt_LC_MESSAGES -+ - AC_CONFIG_HEADERS([config.h:configh.in]) - AH_BOTTOM([#include "custom.h"]) - - - -and below you can find the ugly result - ---- gawk-3.1.5/configh.in -+++ gawk-3.1.5/configh.in -@@ -72,6 +76,9 @@ - /* Define to 1 if you have the `isascii' function. */ - #undef HAVE_ISASCII - -+/* Define to 1 if you have the `isblank' function. */ -+#undef HAVE_ISBLANK -+ - /* Define to 1 if you have the `iswctype' function. */ - #undef HAVE_ISWCTYPE - -@@ -81,6 +88,15 @@ - /* Define to 1 if you have the `iswupper' function. */ - #undef HAVE_ISWUPPER - -+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ -+#undef HAVE_LANGINFO_CODESET -+ -+/* Define to 1 if you have the <langinfo.h> header file. */ -+#undef HAVE_LANGINFO_H -+ -+/* Define if your <locale.h> file defines LC_MESSAGES. */ -+#undef HAVE_LC_MESSAGES -+ - /* Define to 1 if you have the `dl' library (-ldl). */ - #undef HAVE_LIBDL - ---- gawk-3.1.5/configure -+++ gawk-3.1.5/configure -@@ -12821,6 +12821,386 @@ - - - -+ -+ echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 -+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 -+if test "${am_cv_langinfo_codeset+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <langinfo.h> -+int -+main () -+{ -+char* cs = nl_langinfo(CODESET); -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ am_cv_langinfo_codeset=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+am_cv_langinfo_codeset=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ -+fi -+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 -+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 -+ if test $am_cv_langinfo_codeset = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LANGINFO_CODESET 1 -+_ACEOF -+ -+ fi -+ -+ -+for ac_header in langinfo.h -+do -+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+else -+ # Is the header compilable? -+echo "$as_me:$LINENO: checking $ac_header usability" >&5 -+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+$ac_includes_default -+#include <$ac_header> -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_header_compiler=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_header_compiler=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -+echo "${ECHO_T}$ac_header_compiler" >&6 -+ -+# Is the header present? -+echo "$as_me:$LINENO: checking $ac_header presence" >&5 -+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -+cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <$ac_header> -+_ACEOF -+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } >/dev/null; then -+ if test -s conftest.err; then -+ ac_cpp_err=$ac_c_preproc_warn_flag -+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag -+ else -+ ac_cpp_err= -+ fi -+else -+ ac_cpp_err=yes -+fi -+if test -z "$ac_cpp_err"; then -+ ac_header_preproc=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.$ac_ext -+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -+echo "${ECHO_T}$ac_header_preproc" >&6 -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in -+ yes:no: ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} -+ ac_header_preproc=yes -+ ;; -+ no:yes:* ) -+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} -+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} -+ ( -+ cat <<\_ASBOX -+## ------------------------------- ## -+## Report this to bug-gawk@gnu.org ## -+## ------------------------------- ## -+_ASBOX -+ ) | -+ sed "s/^/$as_me: WARNING: /" >&2 -+ ;; -+esac -+echo "$as_me:$LINENO: checking for $ac_header" >&5 -+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_Header+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ eval "$as_ac_Header=\$ac_header_preproc" -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -+ -+fi -+if test `eval echo '${'$as_ac_Header'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+for ac_func in isblank -+do -+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -+echo "$as_me:$LINENO: checking for $ac_func" >&5 -+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -+if eval "test \"\${$as_ac_var+set}\" = set"; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. -+ For example, HP-UX 11i <limits.h> declares gettimeofday. */ -+#define $ac_func innocuous_$ac_func -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char $ac_func (); below. -+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -+ <limits.h> exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include <limits.h> -+#else -+# include <assert.h> -+#endif -+ -+#undef $ac_func -+ -+/* Override any gcc2 internal prototype to avoid an error. */ -+#ifdef __cplusplus -+extern "C" -+{ -+#endif -+/* We use char because int might match the return type of a gcc2 -+ builtin and then its argument prototype would still apply. */ -+char $ac_func (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -+choke me -+#else -+char (*f) () = $ac_func; -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+int -+main () -+{ -+return f != $ac_func; -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ eval "$as_ac_var=yes" -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+eval "$as_ac_var=no" -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -+if test `eval echo '${'$as_ac_var'}'` = yes; then -+ cat >>confdefs.h <<_ACEOF -+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+ -+ echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 -+echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 -+if test "${gt_cv_val_LC_MESSAGES+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include <locale.h> -+int -+main () -+{ -+return LC_MESSAGES -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ gt_cv_val_LC_MESSAGES=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+gt_cv_val_LC_MESSAGES=no -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $gt_cv_val_LC_MESSAGES" >&5 -+echo "${ECHO_T}$gt_cv_val_LC_MESSAGES" >&6 -+ if test $gt_cv_val_LC_MESSAGES = yes; then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_LC_MESSAGES 1 -+_ACEOF -+ -+ fi -+ -+ - ac_config_files="$ac_config_files Makefile awklib/Makefile doc/Makefile po/Makefile.in test/Makefile version.c:version.in" - - diff --git a/sys-apps/gawk/files/gawk-3.1.5-binmode.patch b/sys-apps/gawk/files/gawk-3.1.5-binmode.patch deleted file mode 100644 index ab811d2c92f7..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-binmode.patch +++ /dev/null @@ -1,20 +0,0 @@ -Ripped from Fedora - -* Thu Dec 22 2005 Karel Zak <kzak@redhat.com> 3.1.5-5 -- fix "gawk -v BINMODE=1" (patch by Aharon Robbins) - - * eval.c (set_BINMODE): Fix logic of test for no numeric value. - Makes `gawk -v BINMODE=1 ...' work again. Thanks to Eli Zaretskii - <eliz@gnu.org> for pointing out the problem. - ---- gawk-3.1.5/eval.c.binmode 2005-12-22 19:05:32.000000000 +0100 -+++ gawk-3.1.5/eval.c 2005-12-22 19:06:40.000000000 +0100 -@@ -2167,7 +2167,7 @@ - } - } - -- if (! digits || (BINMODE_node->var_value->flags & MAYBE_NUM) == 0) { -+ if (! digits && (BINMODE_node->var_value->flags & MAYBE_NUM) == 0) { - BINMODE = 0; - if (strcmp(p, "r") == 0) - BINMODE = 1; diff --git a/sys-apps/gawk/files/gawk-3.1.5-core.patch b/sys-apps/gawk/files/gawk-3.1.5-core.patch deleted file mode 100644 index 651052e2b841..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-core.patch +++ /dev/null @@ -1,36 +0,0 @@ -fix an ugly core on a simple script - -http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00040.html -http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html - -corresponds to this Fedora fix: -* Tue Sep 27 2005 Karel Zak <kzak@redhat.com> 3.1.5-3 -- fix #169374 - Invalid Free (patch by Aharon Robbins) -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=169374 - ---- io.c -+++ io.c -@@ -2480,9 +2480,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; -@@ -2495,7 +2498,8 @@ - } - - if (iop->fd == INVALID_HANDLE) { -- free(iop); -+ if (iop_malloced) -+ free(iop); - return NULL; - } - if (isatty(iop->fd)) diff --git a/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch b/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch deleted file mode 100644 index 905718b1f2f6..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-fieldwidths.patch +++ /dev/null @@ -1,35 +0,0 @@ -Ripped from Fedora - -* Sun Oct 9 2005 Karel Zak <kzak@redhat.com> 3.1.5-4 -- fix off-by-one error in assignment of sentinel value at - end of FIELDWIDTHS array. (patch by Aharon Robbins) - ---- gawk-3.1.5/field.c.fieldwidths 2005-05-11 17:28:15.000000000 +0200 -+++ gawk-3.1.5/field.c 2005-10-09 08:35:54.000000000 +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"); - } diff --git a/sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch b/sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch deleted file mode 100644 index 1ec22fb8edfc..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-freewstr2.patch +++ /dev/null @@ -1,257 +0,0 @@ -Ripped from Fedora - ---- gawk-3.1.5/field.c.freewstr 2007-01-15 11:02:51.000000000 +0100 -+++ gawk-3.1.5/field.c 2007-01-15 11:21:56.000000000 +0100 -@@ -155,6 +155,7 @@ - ofs = force_string(OFS_node->var_value); - ofslen = ofs->stlen; - for (i = NF; i > 0; i--) { -+ free_wstr(fields_arr[i]); - tmp = fields_arr[i]; - tmp = force_string(tmp); - tlen += tmp->stlen; -@@ -922,7 +923,7 @@ - FIELDWIDTHS[0] = 0; - for (i = 1; ; i++) { - unsigned long int tmp; -- if (i >= fw_alloc) { -+ if (i + 1 >= fw_alloc) { - fw_alloc *= 2; - erealloc(FIELDWIDTHS, int *, fw_alloc * sizeof(int), "set_FIELDWIDTHS"); - } ---- gawk-3.1.5/builtin.c.freewstr 2005-07-26 20:07:43.000000000 +0200 -+++ gawk-3.1.5/builtin.c 2007-01-15 11:12:52.000000000 +0100 -@@ -2089,9 +2089,9 @@ - } - - free(buf); -- if (wc_indices != NULL) -- free(wc_indices); - } -+ if (wc_indices != NULL) -+ free(wc_indices); - } else { /* match failed */ - rstart = 0; - rlength = -1; -@@ -2462,6 +2462,8 @@ - free(t->stptr); - t->stptr = buf; - t->stlen = textlen; -+ free_wstr(t); -+ t->flags &= ~(NUMCUR|NUMBER); - - free_temp(s); - if (matches > 0 && lhs) { -@@ -2471,7 +2473,6 @@ - } - if (after_assign != NULL) - (*after_assign)(); -- t->flags &= ~(NUMCUR|NUMBER); - } - if (mb_indices != NULL) - free(mb_indices); ---- gawk-3.1.5/awk.h.freewstr 2005-07-26 20:07:43.000000000 +0200 -+++ gawk-3.1.5/awk.h 2007-01-15 11:02:51.000000000 +0100 -@@ -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)); ---- gawk-3.1.5/node.c.freewstr 2007-01-15 11:02:51.000000000 +0100 -+++ gawk-3.1.5/node.c 2007-01-15 11:33:44.000000000 +0100 -@@ -96,6 +96,7 @@ - if (! do_traditional && isnondecimal(cp, TRUE)) { - n->numbr = nondec2awknum(cp, cpend - cp); - n->flags |= NUMCUR; -+ ptr = cpend; - goto finish; - } - } -@@ -218,15 +219,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; - } - -@@ -289,8 +282,14 @@ - *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; -+ r->wstlen = 0; - #endif /* defined MBS_SUPPORT */ - if (n->type == Node_val && (n->flags & STRCUR) != 0) { - r->stref = 1; -@@ -346,11 +345,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_wstr(r); - #endif /* GAWKDEBUG */ - return r; - } -@@ -365,10 +360,11 @@ - getnode(r); - r->type = Node_val; - r->flags = (STRING|STRCUR|MALLOC); --#if defined MBS_SUPPORT -+#ifdef MBS_SUPPORT - r->wstptr = NULL; - r->wstlen = 0; --#endif -+#endif /* defined MBS_SUPPORT */ -+ - if (flags & ALREADY_MALLOCED) - r->stptr = s; - else { -@@ -512,20 +508,13 @@ - 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; - } - if ((tmp->flags & FIELD) != 0) { -+ free_wstr(tmp); - freenode(tmp); - return; - } -@@ -706,12 +695,8 @@ - return n; - /* otherwise - fall through and recompute to fill in the array */ -- } -- -- if (n->wstptr != NULL) { -- free(n->wstptr); -- n->wstptr = NULL; -- n->wstlen = 0; -+ if (n->wstptr != NULL) -+ free_wstr(n); - } - - /* -@@ -752,8 +737,8 @@ - case (size_t) -2: - case (size_t) -1: - case 0: -- goto done; -- -+ count = 1; -+ /* fall through */ - default: - *wsp++ = wc; - src_count -= count; -@@ -777,6 +762,20 @@ - 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) ---- gawk-3.1.5/dfa.c.freewstr 2007-01-15 11:13:19.000000000 +0100 -+++ gawk-3.1.5/dfa.c 2007-01-15 11:17:44.000000000 +0100 -@@ -516,7 +516,6 @@ - - work_mbc->nchars = work_mbc->nranges = work_mbc->nch_classes = 0; - work_mbc->nequivs = work_mbc->ncoll_elems = 0; -- work_mbc->chars = NULL; - work_mbc->ch_classes = NULL; - work_mbc->range_sts = work_mbc->range_ends = NULL; - work_mbc->equivs = work_mbc->coll_elems = NULL; -@@ -1602,8 +1601,8 @@ - d->states[i].constraint = 0; - d->states[i].first_end = 0; - #ifdef MBS_SUPPORT -- if (MB_CUR_MAX > 1) -- d->states[i].mbps.nelem = 0; -+ d->states[i].mbps.nelem = 0; -+ d->states[i].mbps.elems = NULL; - #endif - for (j = 0; j < s->nelem; ++j) - if (d->tokens[s->elems[j].index] < 0) -@@ -3136,8 +3135,13 @@ - } - #endif /* MBS_SUPPORT */ - -- for (i = 0; i < d->sindex; ++i) -+ for (i = 0; i < d->sindex; ++i) { - free((ptr_t) d->states[i].elems.elems); -+#ifdef MBS_SUPPORT -+ if (d->states[i].mbps.nelem > 0) -+ free((ptr_t) d->states[i].mbps.elems); -+#endif /* MBS_SUPPORT */ -+ } - free((ptr_t) d->states); - for (i = 0; i < d->tindex; ++i) - if (d->follows[i].elems) ---- gawk-3.1.5/eval.c.freewstr 2007-01-15 11:02:51.000000000 +0100 -+++ gawk-3.1.5/eval.c 2007-01-15 11:02:51.000000000 +0100 -@@ -1176,13 +1176,7 @@ - memcpy(l->stptr + l->stlen, r->stptr, r->stlen); - l->stlen += r->stlen; - l->stptr[l->stlen] = '\0'; --#if defined MBS_SUPPORT -- if (r->wstptr != NULL) -- free(r->wstptr); -- r->wstptr = NULL; -- r->wstlen = 0; -- r->flags &= ~WSTRCUR; --#endif /* MBS_SUPPORT */ -+ free_wstr(l); - } else { - char *nval; - size_t nlen = l->stlen + r->stlen + 2; diff --git a/sys-apps/gawk/files/gawk-3.1.5-gcc4.patch b/sys-apps/gawk/files/gawk-3.1.5-gcc4.patch deleted file mode 100644 index 3ebadcbe6684..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-gcc4.patch +++ /dev/null @@ -1,23 +0,0 @@ -Sat Sep 3 16:03:25 EDT 2005 Kito Danya Dietrich <kito@gentoo.org> - - * hard-locale.h (hard_locale): Declare xmalloc in global scope rather than - function scope which gcc-4.x rejects. - ---- gawk-3.1.5/hard-locale.h -+++ gawk-3.1.5/hard-locale.h -@@ -21,6 +21,7 @@ - along with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - -+static ptr_t xmalloc PARAMS ((size_t n)); - - /* Return nonzero if the current CATEGORY locale is hard, i.e. if you - can't get away with assuming traditional C or POSIX behavior. */ -@@ -40,7 +41,6 @@ - if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0) - hard = 0; - # else -- static ptr_t xmalloc PARAMS ((size_t n)); - - char *locale = xmalloc (strlen (p) + 1); - strcpy (locale, p); diff --git a/sys-apps/gawk/files/gawk-3.1.5-internal.patch b/sys-apps/gawk/files/gawk-3.1.5-internal.patch deleted file mode 100644 index a049730043d5..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-internal.patch +++ /dev/null @@ -1,204 +0,0 @@ -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. - ---- gawk-3.1.5/io.c.internal 2006-06-21 19:46:59.000000000 +0200 -+++ gawk-3.1.5/io.c 2006-06-21 19:49:54.000000000 +0200 -@@ -110,6 +110,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 +164,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 +1423,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,23 +1448,20 @@ - - 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; - } - - - /* 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]; -@@ -1478,6 +1470,12 @@ - - warning(_("use `PROCINFO[\"%s\"]' instead of `%s'"), cp, name); - -+ if (iop == NULL) { -+ iop = iop_alloc(INVALID_HANDLE, name, iop); -+ if (iop == NULL) -+ return NULL; -+ } -+ - if (name[6] == 'g') - #ifdef GETPGRP_VOID - sprintf(tbuf, "%d\n", (int) getpgrp()); -@@ -1489,9 +1487,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 */ -@@ -1506,7 +1504,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; -@@ -1514,6 +1512,12 @@ - - warning(_("use `PROCINFO[...]' instead of `/dev/user'")); - -+ if (iop == NULL) { -+ iop = iop_alloc(INVALID_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); -@@ -1528,9 +1532,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 */ -@@ -1543,8 +1547,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 }, -@@ -1569,12 +1572,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'"), -@@ -2909,6 +2907,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; diff --git a/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch b/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch deleted file mode 100644 index 1bb2345618c9..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-ipv6.patch +++ /dev/null @@ -1,301 +0,0 @@ -Ripped from Fedora - -diff -bru gawk-3.1.5.orig/io.c gawk-3.1.5/io.c ---- gawk-3.1.5.orig/io.c 2006-07-07 16:13:08.000000000 +0200 -+++ gawk-3.1.5/io.c 2006-07-10 13:18:13.000000000 +0200 -@@ -71,7 +71,6 @@ - extern int MRL; - - #ifdef HAVE_SOCKETS --enum inet_prot { INET_NONE, INET_TCP, INET_UDP, INET_RAW }; - - #ifndef SHUT_RD - #define SHUT_RD 0 -@@ -1133,24 +1132,60 @@ - /* socketopen --- open a socket and set it into connected state */ - - static int --socketopen(enum inet_prot type, int localport, int remoteport, const char *remotehostname) -+socketopen(int type, const char *localpname, const char *remotepname, -+ const char *remotehostname) - { -- struct hostent *hp = gethostbyname(remotehostname); -- struct sockaddr_in local_addr, remote_addr; -+ struct addrinfo *lres, *lres0; -+ struct addrinfo lhints; -+ struct addrinfo *rres, *rres0; -+ struct addrinfo rhints; -+ -+ int lerror; -+ int rerror; -+ - int socket_fd; - int any_remote_host = strcmp(remotehostname, "0"); - -+ memset (&lhints, '\0', sizeof (lhints)); -+ lhints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; -+ lhints.ai_socktype = type; -+ -+ lerror = getaddrinfo (NULL, localpname, &lhints, &lres); -+ if (lerror) { -+ if (strcmp(localpname, "0")) -+ fatal(_("local port invalid in `/inet'")); -+ lres0 = NULL; -+ lres = &lhints; -+ } else -+ lres0 = lres; -+ -+ while (lres) { -+ memset (&rhints, '\0', sizeof (rhints)); -+ rhints.ai_flags = lhints.ai_flags; -+ rhints.ai_socktype = lhints.ai_socktype; -+ rhints.ai_family = lhints.ai_family; -+ rhints.ai_protocol = lhints.ai_protocol; -+ -+ rerror = getaddrinfo (remotehostname, remotepname, &rhints, &rres); -+ if (rerror) { -+ if (lres0) -+ freeaddrinfo(lres0); -+ fatal(_("remote host and port information invalid")); -+ } -+ rres0 = rres; - socket_fd = INVALID_HANDLE; -- switch (type) { -- case INET_TCP: -- if (localport != 0 || remoteport != 0) { -+ while (rres) { -+ socket_fd = socket (rres->ai_family, -+ rres->ai_socktype, rres->ai_protocol); -+ if (socket_fd < 0 || socket_fd == INVALID_HANDLE) -+ goto nextrres; -+ -+ if (type == SOCK_STREAM) { - int on = 1; - #ifdef SO_LINGER - struct linger linger; -- - memset(& linger, '\0', sizeof(linger)); - #endif -- socket_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - setsockopt(socket_fd, SOL_SOCKET, SO_REUSEADDR, - (char *) & on, sizeof(on)); - #ifdef SO_LINGER -@@ -1160,57 +1195,27 @@ - (char *) & linger, sizeof(linger)); - #endif - } -- break; -- case INET_UDP: -- if (localport != 0 || remoteport != 0) -- socket_fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -- break; -- case INET_RAW: --#ifdef SOCK_RAW -- if (localport == 0 && remoteport == 0) -- socket_fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW); --#endif -- break; -- case INET_NONE: -- /* fall through */ -- default: -- cant_happen(); -- break; -- } -+ if (bind(socket_fd, lres->ai_addr, lres->ai_addrlen) != 0) -+ goto nextrres; - -- if (socket_fd < 0 || socket_fd == INVALID_HANDLE -- || (hp == NULL && any_remote_host != 0)) -- return INVALID_HANDLE; -- -- local_addr.sin_family = remote_addr.sin_family = AF_INET; -- local_addr.sin_addr.s_addr = htonl(INADDR_ANY); -- remote_addr.sin_addr.s_addr = htonl(INADDR_ANY); -- local_addr.sin_port = htons(localport); -- remote_addr.sin_port = htons(remoteport); -- if (bind(socket_fd, (struct sockaddr *) &local_addr, sizeof(local_addr)) == 0) { - if (any_remote_host != 0) { /* not ANY => create a client */ -- if (type == INET_TCP || type == INET_UDP) { -- memcpy(&remote_addr.sin_addr, hp->h_addr, -- sizeof(remote_addr.sin_addr)); -- if (connect(socket_fd, -- (struct sockaddr *) &remote_addr, -- sizeof(remote_addr)) != 0) { -- close(socket_fd); -- if (localport == 0) -- socket_fd = INVALID_HANDLE; -- else -- socket_fd = socketopen(type, localport, 0, "0"); -- } -+ if (type != SOCK_RAW) { -+ if (connect(socket_fd, rres->ai_addr, -+ rres->ai_addrlen) == 0) -+ break; - } else { - /* /inet/raw client not ready yet */ - fatal(_("/inet/raw client not ready yet, sorry")); - if (geteuid() != 0) -+ /* FIXME: is this second fatal ever reached? */ - fatal(_("only root may use `/inet/raw'.")); - } - } else { /* remote host is ANY => create a server */ -- if (type == INET_TCP) { -+ if (type == SOCK_STREAM) { - int clientsocket_fd = INVALID_HANDLE; -- socklen_t namelen = sizeof(remote_addr); -+ -+ struct sockaddr_storage remote_addr; -+ socklen_t namelen = sizeof (remote_addr); - - if (listen(socket_fd, 1) >= 0 - && (clientsocket_fd = accept(socket_fd, -@@ -1218,25 +1223,22 @@ - &namelen)) >= 0) { - close(socket_fd); - socket_fd = clientsocket_fd; -- } else { -- close(socket_fd); -- socket_fd = INVALID_HANDLE; -+ break; - } -- } else if (type == INET_UDP) { -+ } else if (type == SOCK_DGRAM) { - #ifdef MSG_PEEK - char buf[10]; -+ struct sockaddr_storage remote_addr; - socklen_t readle; - - if (recvfrom(socket_fd, buf, 1, MSG_PEEK, - (struct sockaddr *) & remote_addr, -- & readle) < 1 -- || readle != sizeof(remote_addr) -- || connect(socket_fd, -+ & readle) >= 0 -+ && readle -+ && connect(socket_fd, - (struct sockaddr *)& remote_addr, -- readle) != 0) { -- close(socket_fd); -- socket_fd = INVALID_HANDLE; -- } -+ readle) == 0) -+ break; - #endif - } else { - /* /inet/raw server not ready yet */ -@@ -1245,10 +1247,20 @@ - fatal(_("only root may use `/inet/raw'.")); - } - } -- } else { -+ -+nextrres: -+ if (socket_fd != INVALID_HANDLE) - close(socket_fd); - socket_fd = INVALID_HANDLE; -+ rres = rres->ai_next; -+ } -+ freeaddrinfo(rres0); -+ if (socket_fd != INVALID_HANDLE) -+ break; -+ lres = lres->ai_next; - } -+ if (lres0) -+ freeaddrinfo(lres0); - - return socket_fd; - } -@@ -1313,30 +1325,24 @@ - } else if (STREQN(name, "/inet/", 6)) { - #ifdef HAVE_SOCKETS - /* /inet/protocol/localport/hostname/remoteport */ -- enum inet_prot protocol = INET_NONE; -- int localport, remoteport; -+ int protocol; - char *hostname; - char *hostnameslastcharp; - char *localpname; -- char proto[4]; -- struct servent *service; -+ char *localpnamelastcharp; - - cp = (char *) name + 6; - /* which protocol? */ - if (STREQN(cp, "tcp/", 4)) -- protocol = INET_TCP; -+ protocol = SOCK_STREAM; - else if (STREQN(cp, "udp/", 4)) -- protocol = INET_UDP; -+ protocol = SOCK_DGRAM; - else if (STREQN(cp, "raw/", 4)) -- protocol = INET_RAW; -+ protocol = SOCK_RAW; - else - fatal(_("no (known) protocol supplied in special filename `%s'"), - name); - -- proto[0] = cp[0]; -- proto[1] = cp[1]; -- proto[2] = cp[2]; -- proto[3] = '\0'; - cp += 4; - - /* which localport? */ -@@ -1354,25 +1360,17 @@ - * By using atoi() the use of decimal numbers is enforced. - */ - *cp = '\0'; -- -- localport = atoi(localpname); -- if (strcmp(localpname, "0") != 0 -- && (localport <= 0 || localport > 65535)) { -- service = getservbyname(localpname, proto); -- if (service == NULL) -- fatal(_("local port invalid in `%s'"), name); -- else -- localport = ntohs(service->s_port); -- } -- *cp = '/'; -+ localpnamelastcharp = cp; - - /* which hostname? */ - cp++; - hostname = cp; - while (*cp != '/' && *cp != '\0') - cp++; -- if (*cp != '/' || cp == hostname) -+ if (*cp != '/' || cp == hostname) { -+ *localpnamelastcharp = '/'; - fatal(_("must supply a remote hostname to `/inet'")); -+ } - *cp = '\0'; - hostnameslastcharp = cp; - -@@ -1386,22 +1384,15 @@ - * Here too, require a port, let them explicitly put 0 if - * they don't care. - */ -- if (*cp == '\0') -+ if (*cp == '\0') { -+ *localpnamelastcharp = '/'; -+ *hostnameslastcharp = '/'; - fatal(_("must supply a remote port to `/inet'")); -- remoteport = atoi(cp); -- if (strcmp(cp, "0") != 0 -- && (remoteport <= 0 || remoteport > 65535)) { -- service = getservbyname(cp, proto); -- if (service == NULL) -- fatal(_("remote port invalid in `%s'"), name); -- else -- remoteport = ntohs(service->s_port); - } - -- /* Open Sesame! */ -- openfd = socketopen(protocol, localport, remoteport, hostname); -+ openfd = socketopen(protocol, localpname, cp, hostname); -+ *localpnamelastcharp = '/'; - *hostnameslastcharp = '/'; -- - #else /* ! HAVE_SOCKETS */ - fatal(_("TCP/IP communications are not supported")); - #endif /* HAVE_SOCKETS */ diff --git a/sys-apps/gawk/files/gawk-3.1.5-mbread.patch b/sys-apps/gawk/files/gawk-3.1.5-mbread.patch deleted file mode 100644 index 078c97d1b6f1..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-mbread.patch +++ /dev/null @@ -1,41 +0,0 @@ -Ripped from Fedora - - Date: Mon, 18 Dec 2006 18:38:13 +0300 - From: "Dmitry V. Levin" <ldv@altlinux.org> - Subject: gawk: do_match() invalid read - To: bug-gawk@gnu.org - - Due to missing mounds check, do_match() may do invalid read in multibyte - locales: - - $ printf '\n\n' |env -i gawk '{print match(""," *")}' - 1 - 1 - $ printf '\n\n' |env -i LC_ALL=3Dru_RU.UTF-8 gawk '{print match(""," *")}' - -1208299079 - 134843273 - - As you see, match() output in multibyte locale is wrong; valgrind reports - about "Invalid read of size 4". - - ---- gawk-3.1.5/builtin.c.mbread 2007-01-12 13:23:55.000000000 +0100 -+++ gawk-3.1.5/builtin.c 2007-01-12 13:24:41.000000000 +0100 -@@ -2020,7 +2020,7 @@ - - rlength = REEND(rp, t1->stptr) - RESTART(rp, t1->stptr); /* byte length */ - #ifdef MBS_SUPPORT -- if (gawk_mb_cur_max > 1) { -+ if (rlength > 0 && gawk_mb_cur_max > 1) { - t1 = str2wstr(t1, & wc_indices); - rlength = wc_indices[rstart + rlength - 1] - wc_indices[rstart] + 1; - rstart = wc_indices[rstart]; -@@ -2046,7 +2046,7 @@ - subpat_start = s; - subpat_len = len = SUBPATEND(rp, t1->stptr, ii) - s; - #ifdef MBS_SUPPORT -- if (gawk_mb_cur_max > 1) { -+ if (len > 0 && gawk_mb_cur_max > 1) { - subpat_start = wc_indices[s]; - subpat_len = wc_indices[s + len - 1] - subpat_start + 1; - } diff --git a/sys-apps/gawk/files/gawk-3.1.5-num2str.patch b/sys-apps/gawk/files/gawk-3.1.5-num2str.patch deleted file mode 100644 index 57ecd46b4762..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-num2str.patch +++ /dev/null @@ -1,42 +0,0 @@ -Ripped from Fedora - -* Thu Dec 22 2005 Karel Zak <kzak@redhat.com> 3.1.5-5 -- fix conversion from large number to string (patch by Aharon Robbins) - ---- gawk-3.1.5/node.c.num2str 2005-07-26 20:07:43.000000000 +0200 -+++ gawk-3.1.5/node.c 2005-12-22 19:41:55.000000000 +0100 -@@ -151,6 +151,7 @@ - register char *sp = buf; - double val; - char *orig, *trans, save; -+ register long num; - - if (! do_traditional && (s->flags & INTLSTR) != 0) { - save = s->stptr[s->stlen]; -@@ -163,9 +164,12 @@ - return tmp_string(trans, strlen(trans)); - } - -- /* not an integral value, or out of range */ -- if ((val = double_to_int(s->numbr)) != s->numbr -- || val < LONG_MIN || val > LONG_MAX) { -+ /* conversion to long overflows, or out of range, or not integral */ -+ val = double_to_int(s->numbr); -+ num = (long) val; -+ if ( (s->numbr > 0 && num < 0) -+ || (s->numbr < 0 && num > 0) -+ || val < LONG_MIN || val > LONG_MAX || val != s->numbr) { - /* - * Once upon a time, if GFMT_WORKAROUND wasn't defined, - * we just blindly did this: -@@ -199,9 +203,7 @@ - - goto no_malloc; - } else { -- /* integral value */ -- /* force conversion to long only once */ -- register long num = (long) val; -+ /* integral value, in range, too! */ - if (num < NVAL && num >= 0) { - sp = (char *) values[num]; - s->stlen = 1; diff --git a/sys-apps/gawk/files/gawk-3.1.5-numflags.patch b/sys-apps/gawk/files/gawk-3.1.5-numflags.patch deleted file mode 100644 index a0ada4b5b20c..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-numflags.patch +++ /dev/null @@ -1,16 +0,0 @@ -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.numflags 2006-07-10 09:36:26.000000000 +0200 -+++ gawk-3.1.5/eval.c 2006-07-10 09:36:41.000000000 +0200 -@@ -1193,6 +1193,7 @@ - unref(*lhs); - *lhs = make_str_node(nval, l->stlen + r->stlen, ALREADY_MALLOCED); - } -+ (*lhs)->flags &= ~(NUMCUR|NUMBER); - free_temp(r); - - if (after_assign) diff --git a/sys-apps/gawk/files/gawk-3.1.5-syntaxerror.patch b/sys-apps/gawk/files/gawk-3.1.5-syntaxerror.patch deleted file mode 100644 index 34742f08a6c4..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-syntaxerror.patch +++ /dev/null @@ -1,17 +0,0 @@ -Fri Jun 23 15:48:34 2006 Arnold D. Robbins <arnold@skeeve.com> - - * awkgram.y (subn): At end for `do_sprintf' check, verify that lnode is not NULL - before using it assign through. - ---- gawk-3.1.5/awkgram.y.syntaxerror 2005-07-26 20:07:43.000000000 +0200 -+++ gawk-3.1.5/awkgram.y 2006-06-23 17:43:55.000000000 +0200 -@@ -2399,7 +2399,8 @@ - r->subnode = subn; - if (r->builtin == do_sprintf) { - count_args(r); -- r->lnode->printf_count = r->printf_count; /* hack */ -+ if (r->lnode != NULL) /* r->lnode set from subn. guard against syntax errors & check it's valid */ -+ r->lnode->printf_count = r->printf_count; /* hack */ - } - return r; - } diff --git a/sys-apps/gawk/files/gawk-3.1.5-wconcat.patch b/sys-apps/gawk/files/gawk-3.1.5-wconcat.patch deleted file mode 100644 index e082f2457518..000000000000 --- a/sys-apps/gawk/files/gawk-3.1.5-wconcat.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- gawk-3.1.5/eval.c.wconcat 2006-02-14 09:40:54.000000000 +0100 -+++ gawk-3.1.5/eval.c 2006-02-14 09:43:33.000000000 +0100 -@@ -1176,6 +1176,13 @@ - memcpy(l->stptr + l->stlen, r->stptr, r->stlen); - l->stlen += r->stlen; - l->stptr[l->stlen] = '\0'; -+#if defined MBS_SUPPORT -+ if (r->wstptr != NULL) -+ free(r->wstptr); -+ r->wstptr = NULL; -+ r->wstlen = 0; -+ r->flags &= ~WSTRCUR; -+#endif /* MBS_SUPPORT */ - } else { - char *nval; - size_t nlen = l->stlen + r->stlen + 2; diff --git a/sys-apps/gawk/gawk-3.1.5-r5.ebuild b/sys-apps/gawk/gawk-3.1.5-r5.ebuild deleted file mode 100644 index d53aee7f06a6..000000000000 --- a/sys-apps/gawk/gawk-3.1.5-r5.ebuild +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/gawk/gawk-3.1.5-r5.ebuild,v 1.9 2007/12/11 10:19:43 vapier Exp $ - -inherit eutils toolchain-funcs multilib - -DESCRIPTION="GNU awk pattern-matching language" -HOMEPAGE="http://www.gnu.org/software/gawk/gawk.html" -SRC_URI="mirror://gnu/gawk/${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" -IUSE="nls" - -RDEPEND="" -DEPEND="${RDEPEND} - nls? ( sys-devel/gettext )" - -SFFS=${WORKDIR}/filefuncs - -src_unpack() { - unpack ${P}.tar.gz - - # Copy filefuncs module's source over ... - cp -r "${FILESDIR}"/filefuncs "${SFFS}" || die "cp failed" - - cd "${S}" - epatch "${FILESDIR}"/${P}-core.patch - epatch "${FILESDIR}"/${P}-gcc4.patch - epatch "${FILESDIR}"/${P}-autotools-crap.patch #139397 - # Patches from Fedora - epatch "${FILESDIR}"/${PN}-3.1.3-getpgrp_void.patch - epatch "${FILESDIR}"/${P}-fieldwidths.patch #127163 - epatch "${FILESDIR}"/${P}-binmode.patch - epatch "${FILESDIR}"/${P}-num2str.patch - epatch "${FILESDIR}"/${P}-internal.patch - epatch "${FILESDIR}"/${P}-numflags.patch - epatch "${FILESDIR}"/${P}-syntaxerror.patch - epatch "${FILESDIR}"/${P}-wconcat.patch - epatch "${FILESDIR}"/${P}-ipv6.patch - epatch "${FILESDIR}"/${P}-mbread.patch - epatch "${FILESDIR}"/${P}-freewstr2.patch #135931 #188740 -} - -src_compile() { - local bindir=/usr/bin - use userland_GNU && bindir=/bin - econf \ - --bindir=${bindir} \ - --libexec='$(libdir)/misc' \ - $(use_enable nls) \ - --enable-switch \ - || die - emake || die "emake failed" - - cd "${SFFS}" - emake CC=$(tc-getCC) || die "filefuncs emake failed" -} - -src_install() { - emake install DESTDIR="${D}" || die "install failed" - cd "${SFFS}" - emake LIBDIR="$(get_libdir)" install || die "filefuncs install failed" - - dodir /usr/bin - # In some rare cases, (p)gawk gets installed as (p)gawk- and not - # (p)gawk-${PV} ... Also make sure that /bin/(p)gawk is a symlink - # to /bin/(p)gawk-${PV}. - local bindir=/usr/bin binpath= x= - use userland_GNU && bindir=/bin - for x in gawk pgawk igawk ; do - [[ ${x} == "gawk" ]] \ - && binpath=${bindir} \ - || binpath=/usr/bin - - if [[ -f ${D}/${bindir}/${x} && ! -f ${D}/${bindir}/${x}-${PV} ]] ; then - mv -f "${D}"/${bindir}/${x} "${D}"/${binpath}/${x}-${PV} - elif [[ -f ${D}/${bindir}/${x}- && ! -f ${D}/${bindir}/${x}-${PV} ]] ; then - mv -f "${D}"/${bindir}/${x}- "${D}"/${binpath}/${x}-${PV} - elif [[ ${binpath} == "/usr/bin" && -f ${D}/${bindir}/${x}-${PV} ]] ; then - mv -f "${D}"/${bindir}/${x}-${PV} "${D}"/${binpath}/${x}-${PV} - fi - - rm -f "${D}"/${bindir}/${x} - [[ -x "${D}"/${binpath}/${x}-${PV} ]] && dosym ${x}-${PV} ${binpath}/${x} - if use userland_GNU ; then - [[ ${binpath} == "/usr/bin" ]] && dosym /usr/bin/${x}-${PV} /bin/${x} - fi - done - - rm -f "${D}"/bin/awk - dodir /usr/bin - # Compat symlinks - dosym gawk-${PV} ${bindir}/awk - dosym ${bindir}/gawk-${PV} /usr/bin/awk - if use userland_GNU ; then - dosym /bin/gawk-${PV} /usr/bin/gawk - else - rm -f "${D}"/{,usr/}bin/awk{,-${PV}} - fi - - # Install headers - insinto /usr/include/awk - doins "${S}"/*.h || die "ins headers failed" - # We do not want 'acconfig.h' in there ... - rm -f "${D}"/usr/include/awk/acconfig.h - - cd "${S}" - rm -f "${D}"/usr/share/man/man1/pgawk.1 - dosym gawk.1 /usr/share/man/man1/pgawk.1 - if use userland_GNU ; then - dosym gawk.1 /usr/share/man/man1/awk.1 - fi - dodoc AUTHORS ChangeLog FUTURES LIMITATIONS NEWS PROBLEMS POSIX.STD README - docinto README_d - dodoc README_d/* - docinto awklib - dodoc awklib/ChangeLog - docinto pc - dodoc pc/ChangeLog - docinto posix - dodoc posix/ChangeLog -} |