- rel 2; upstream fixes used in fc master auto/th/gawk-4.2.1-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 10 Oct 2018 13:54:17 +0000 (15:54 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Wed, 10 Oct 2018 13:54:28 +0000 (15:54 +0200)
gawk-4.2.1-000-add-support-for-a-and-A-in-printf.patch [new file with mode: 0644]
gawk-4.2.1-001-remove-the-tail-recursion-optimization.patch [new file with mode: 0644]
gawk-4.2.1-002-copy-MPZ-MPFR-bits-also-in-r_dupnode.patch [new file with mode: 0644]
gawk-4.2.1-003-fix-rebuilding-records-if-using-API-parser.patch [new file with mode: 0644]
gawk-4.2.1-004-fix-a-corner-case-with-EPIPE-to-stdout-stderr.patch [new file with mode: 0644]
gawk.spec

diff --git a/gawk-4.2.1-000-add-support-for-a-and-A-in-printf.patch b/gawk-4.2.1-000-add-support-for-a-and-A-in-printf.patch
new file mode 100644 (file)
index 0000000..eff117b
--- /dev/null
@@ -0,0 +1,1321 @@
+From 51e6897a1dc72dd5e39921e8a1c8fa4efb568ca6 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <arnold@skeeve.com>
+Date: Thu, 22 Mar 2018 18:37:52 +0200
+Subject: [PATCH] Add support for %a and %A in printf.
+
+---
+ NEWS            |   5 +
+ builtin.c       |  31 +-
+ configh.in      |   3 +
+ configure       |  42 +++
+ configure.ac    |  28 ++
+ doc/awkcard.in  |   1 +
+ doc/gawk.1      |  12 +-
+ doc/gawk.info   | 925 ++++++++++++++++++++++++++++----------------------------
+ doc/gawk.texi   |  19 ++
+ doc/gawktexi.in |  19 ++
+ doc/wordlist    |   2 +
+ doc/wordlist2   |   1 +
+ pc/config.h     |   3 +
+ pc/config.sed   |   2 +
+ 14 files changed, 631 insertions(+), 462 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index c2885c8..71d9608 100644
+--- a/NEWS
++++ b/NEWS
+@@ -5,6 +5,11 @@
+    are permitted in any medium without royalty provided the copyright
+    notice and this notice are preserved.
++Changes from 4.2.1 to 4.2.2
++---------------------------
++
++1. Support for the POSIX standard %a and %A formats has been added.
++
+ Changes from 4.2.0 to 4.2.1
+ ---------------------------
+diff --git a/builtin.c b/builtin.c
+index 6927205..c54be9b 100644
+--- a/builtin.c
++++ b/builtin.c
+@@ -1493,6 +1493,17 @@ mpf1:
+               case 'e':
+               case 'f':
+               case 'E':
++#if defined(PRINTF_HAS_A_FORMAT) && PRINTF_HAS_A_FORMAT == 1
++              case 'A':
++              case 'a':
++              {
++                      static bool warned = false;
++                      if (do_lint && tolower(cs1) == 'a' && ! warned) {
++                              warned = true;
++                              lintwarn(_("%%%c format is POSIX standard but not portable to other awks"), cs1);
++                      }
++              }
++#endif
+                       need_format = false;
+                       parse_next_arg();
+                       (void) force_number(arg);
+@@ -1557,11 +1568,21 @@ mpf1:
+                               break;
+ #endif
+                       default:
+-                              sprintf(cp, "*.*%c", cs1);
+-                              while ((nc = snprintf(obufout, ofre, cpbuf,
+-                                           (int) fw, (int) prec,
+-                                           (double) tmpval)) >= ofre)
+-                                      chksize(nc)
++                              if (have_prec || tolower(cs1) != 'a') {
++                                      sprintf(cp, "*.*%c", cs1);
++                                      while ((nc = snprintf(obufout, ofre, cpbuf,
++                                                   (int) fw, (int) prec,
++                                                   (double) tmpval)) >= ofre)
++                                              chksize(nc)
++                              } else {
++                                      // For %a and %A, use the default precision if it
++                                      // wasn't supplied by the user.
++                                      sprintf(cp, "*%c", cs1);
++                                      while ((nc = snprintf(obufout, ofre, cpbuf,
++                                                   (int) fw,
++                                                   (double) tmpval)) >= ofre)
++                                              chksize(nc)
++                              }
+                       }
+ #if defined(LC_NUMERIC)
+diff --git a/configh.in b/configh.in
+index e600005..8c4d94d 100644
+--- a/configh.in
++++ b/configh.in
+@@ -368,6 +368,9 @@
+ /* Define to the version of this package. */
+ #undef PACKAGE_VERSION
++/* Define to 1 if *printf supports %a format */
++#undef PRINTF_HAS_A_FORMAT
++
+ /* Define to 1 if *printf supports %F format */
+ #undef PRINTF_HAS_F_FORMAT
+diff --git a/configure b/configure
+index 2283f09..f492a75 100755
+--- a/configure
++++ b/configure
+@@ -10210,6 +10210,48 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_f_format" >&5
+ $as_echo "$has_f_format" >&6; }
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf %a format" >&5
++$as_echo_n "checking for printf %a format... " >&6; }
++if test "$cross_compiling" = yes; then :
++  has_a_format=no
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++
++#include <stdio.h>
++
++int main()
++{
++      char buf[100];
++
++      sprintf(buf, "%a", 8.0);
++
++      if (strncmp(buf, "0x", 2) == 0)
++              return 0;
++      else
++              return 1;
++}
++
++_ACEOF
++if ac_fn_c_try_run "$LINENO"; then :
++  has_a_format=yes
++else
++  has_a_format=no
++fi
++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++  conftest.$ac_objext conftest.beam conftest.$ac_ext
++fi
++
++if test "$has_a_format" = yes
++then
++
++$as_echo "#define PRINTF_HAS_A_FORMAT 1" >>confdefs.h
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_a_format" >&5
++$as_echo "$has_a_format" >&6; }
++
+ gawk_have_sockets=no
+ # Check for system-dependent location of socket libraries
+diff --git a/configure.ac b/configure.ac
+index f45c710..a4817ee 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -395,6 +395,34 @@ then
+ fi
+ AC_MSG_RESULT($has_f_format)
++dnl check for printf %a format
++AC_MSG_CHECKING([for printf %a format])
++AC_RUN_IFELSE([
++AC_LANG_SOURCE([
++#include <stdio.h>
++
++int main()
++{
++      char buf[[100]];
++
++      sprintf(buf, "%a", 8.0);
++
++      if (strncmp(buf, "0x", 2) == 0)
++              return 0;
++      else
++              return 1;
++}
++])],
++      has_a_format=yes,
++      has_a_format=no,
++      has_a_format=no  dnl Cross-compiling, assuming the worst.
++)
++if test "$has_a_format" = yes
++then
++      AC_DEFINE(PRINTF_HAS_A_FORMAT, 1, [Define to 1 if *printf supports %a format])
++fi
++AC_MSG_RESULT($has_a_format)
++
+ dnl check for sockets
+ GAWK_AC_LIB_SOCKETS
+diff --git a/doc/awkcard.in b/doc/awkcard.in
+index 1148294..d4df342 100644
+--- a/doc/awkcard.in
++++ b/doc/awkcard.in
+@@ -1431,6 +1431,7 @@ the error.\*(CX
+ accept the following conversion specification formats:
+ .sp .5
+ .nf
++\*(CB\*(FC%a\fP, \*(FC%A\fP   A C99 floating point hexadecimal number\*(CD
+ \*(FC%c\fP            An \s-1ASCII\s+1 character
+ \*(FC%d\fP, \*(FC%i\fP        A decimal number (the integer part)
+ \*(FC%e\fP            A floating point number of the form
+diff --git a/doc/gawk.1 b/doc/gawk.1
+index 16762a8..48c07b7 100644
+--- a/doc/gawk.1
++++ b/doc/gawk.1
+@@ -13,7 +13,7 @@
+ .             if \w'\(rq' .ds rq "\(rq
+ .     \}
+ .\}
+-.TH GAWK 1 "Feb 15 2018" "Free Software Foundation" "Utility Commands"
++.TH GAWK 1 "Mar 22 2018" "Free Software Foundation" "Utility Commands"
+ .SH NAME
+ gawk \- pattern scanning and processing language
+ .SH SYNOPSIS
+@@ -1264,7 +1264,7 @@ behavior:
+ \fBPROCINFO["NONFATAL"]\fR
+ If this exists, then I/O errors for all redirections become nonfatal.
+ .TP
+-\fBPROCINFO["\fname\fB", "NONFATAL"]\fR
++\fBPROCINFO["\fIname\fB", "NONFATAL"]\fR
+ Make I/O errors for
+ .I name
+ be nonfatal.
+@@ -2429,6 +2429,14 @@ function
+ (see below)
+ accept the following conversion specification formats:
+ .TP "\w'\fB%g\fR, \fB%G\fR'u+2n"
++.BR "%a" "," " %A"
++A floating point number of the form
++[\fB\-\fP]\fB0x\fIh\fB.\fIhhhh\fBp+\-\fIdd\fR
++(C99 hexadecimal floating point format).
++For
++.BR %A ,
++uppercase letters are used instead of lowercase ones.
++.TP
+ .B %c
+ A single character.
+ If the argument used for
+diff --git a/doc/gawk.info b/doc/gawk.info
+index 738de09..c01e43b 100644
+--- a/doc/gawk.info
++++ b/doc/gawk.info
+@@ -6614,6 +6614,21 @@ print.  The rest of the format specifier is made up of optional
+ "modifiers" that control _how_ to print the value, such as the field
+ width.  Here is a list of the format-control letters:
++'%a', '%A'
++     A floating point number of the form ['-']'0xH.HHHHp+-DD' (C99
++     hexadecimal floating point format).  For '%A', uppercase letters
++     are used instead of lowercase ones.
++
++          NOTE: While the current POSIX standard requires support for
++          '%a' and '%A' in 'awk', as far as we know, no other version of
++          'awk' actually implements it.  It's use is thus highly
++          nonportable!
++
++          Furthermore, these formats are not available on any system
++          where the underlying C library 'printf()' function does not
++          support them.  As of this writing, among current systems, only
++          OpenVMS is known to not support them.
++
+ '%c'
+      Print a number as a character; thus, 'printf "%c", 65' outputs the
+      letter 'A'.  The output for a string value is the first character
+@@ -33759,9 +33774,9 @@ Index
+ * dark corner, FILENAME variable:        Getline Notes.       (line  19)
+ * dark corner, FILENAME variable <1>:    Auto-set.            (line 108)
+ * dark corner, FNR/NR variables:         Auto-set.            (line 389)
+-* dark corner, format-control characters: Control Letters.    (line  18)
++* dark corner, format-control characters: Control Letters.    (line  33)
+ * dark corner, format-control characters <1>: Control Letters.
+-                                                              (line  93)
++                                                              (line 108)
+ * dark corner, FS as null string:        Single Character Fields.
+                                                               (line  20)
+ * dark corner, input files:              awk split records.   (line 110)
+@@ -34459,8 +34474,8 @@ Index
+ * gawk, FIELDWIDTHS variable in:         Fixed width data.    (line  17)
+ * gawk, FIELDWIDTHS variable in <1>:     User-modified.       (line  37)
+ * gawk, file names in:                   Special Files.       (line   6)
+-* gawk, format-control characters:       Control Letters.     (line  18)
+-* gawk, format-control characters <1>:   Control Letters.     (line  93)
++* gawk, format-control characters:       Control Letters.     (line  33)
++* gawk, format-control characters <1>:   Control Letters.     (line 108)
+ * gawk, FPAT variable in:                Splitting By Content.
+                                                               (line  25)
+ * gawk, FPAT variable in <1>:            User-modified.       (line  46)
+@@ -36129,456 +36144,456 @@ Node: OFMT\7f288591
+ Node: Printf\7f289947
+ Node: Basic Printf\7f290732
+ Node: Control Letters\7f292306
+-Node: Format Modifiers\7f296302
+-Node: Printf Examples\7f302317
+-Node: Redirection\7f304803
+-Node: Special FD\7f311644
+-Ref: Special FD-Footnote-1\7f314812
+-Node: Special Files\7f314886
+-Node: Other Inherited Files\7f315503
+-Node: Special Network\7f316504
+-Node: Special Caveats\7f317364
+-Node: Close Files And Pipes\7f318313
+-Ref: table-close-pipe-return-values\7f325220
+-Ref: Close Files And Pipes-Footnote-1\7f326033
+-Ref: Close Files And Pipes-Footnote-2\7f326181
+-Node: Nonfatal\7f326333
+-Node: Output Summary\7f328671
+-Node: Output Exercises\7f329893
+-Node: Expressions\7f330572
+-Node: Values\7f331760
+-Node: Constants\7f332438
+-Node: Scalar Constants\7f333129
+-Ref: Scalar Constants-Footnote-1\7f333993
+-Node: Nondecimal-numbers\7f334243
+-Node: Regexp Constants\7f337244
+-Node: Using Constant Regexps\7f337770
+-Node: Standard Regexp Constants\7f338392
+-Node: Strong Regexp Constants\7f341580
+-Node: Variables\7f344538
+-Node: Using Variables\7f345195
+-Node: Assignment Options\7f347105
+-Node: Conversion\7f348978
+-Node: Strings And Numbers\7f349502
+-Ref: Strings And Numbers-Footnote-1\7f352565
+-Node: Locale influences conversions\7f352674
+-Ref: table-locale-affects\7f355432
+-Node: All Operators\7f356050
+-Node: Arithmetic Ops\7f356679
+-Node: Concatenation\7f359185
+-Ref: Concatenation-Footnote-1\7f362032
+-Node: Assignment Ops\7f362139
+-Ref: table-assign-ops\7f367130
+-Node: Increment Ops\7f368443
+-Node: Truth Values and Conditions\7f371903
+-Node: Truth Values\7f372977
+-Node: Typing and Comparison\7f374025
+-Node: Variable Typing\7f374845
+-Ref: Variable Typing-Footnote-1\7f381308
+-Ref: Variable Typing-Footnote-2\7f381380
+-Node: Comparison Operators\7f381457
+-Ref: table-relational-ops\7f381876
+-Node: POSIX String Comparison\7f385371
+-Ref: POSIX String Comparison-Footnote-1\7f387066
+-Ref: POSIX String Comparison-Footnote-2\7f387205
+-Node: Boolean Ops\7f387289
+-Ref: Boolean Ops-Footnote-1\7f391771
+-Node: Conditional Exp\7f391863
+-Node: Function Calls\7f393599
+-Node: Precedence\7f397476
+-Node: Locales\7f401135
+-Node: Expressions Summary\7f402767
+-Node: Patterns and Actions\7f405340
+-Node: Pattern Overview\7f406460
+-Node: Regexp Patterns\7f408137
+-Node: Expression Patterns\7f408679
+-Node: Ranges\7f412460
+-Node: BEGIN/END\7f415568
+-Node: Using BEGIN/END\7f416329
+-Ref: Using BEGIN/END-Footnote-1\7f419065
+-Node: I/O And BEGIN/END\7f419171
+-Node: BEGINFILE/ENDFILE\7f421485
+-Node: Empty\7f424398
+-Node: Using Shell Variables\7f424715
+-Node: Action Overview\7f426989
+-Node: Statements\7f429314
+-Node: If Statement\7f431162
+-Node: While Statement\7f432657
+-Node: Do Statement\7f434685
+-Node: For Statement\7f435833
+-Node: Switch Statement\7f439004
+-Node: Break Statement\7f441390
+-Node: Continue Statement\7f443482
+-Node: Next Statement\7f445309
+-Node: Nextfile Statement\7f447692
+-Node: Exit Statement\7f450344
+-Node: Built-in Variables\7f452747
+-Node: User-modified\7f453880
+-Node: Auto-set\7f461647
+-Ref: Auto-set-Footnote-1\7f477946
+-Ref: Auto-set-Footnote-2\7f478152
+-Node: ARGC and ARGV\7f478208
+-Node: Pattern Action Summary\7f482421
+-Node: Arrays\7f484851
+-Node: Array Basics\7f486180
+-Node: Array Intro\7f487024
+-Ref: figure-array-elements\7f488999
+-Ref: Array Intro-Footnote-1\7f491703
+-Node: Reference to Elements\7f491831
+-Node: Assigning Elements\7f494295
+-Node: Array Example\7f494786
+-Node: Scanning an Array\7f496545
+-Node: Controlling Scanning\7f499567
+-Ref: Controlling Scanning-Footnote-1\7f504966
+-Node: Numeric Array Subscripts\7f505282
+-Node: Uninitialized Subscripts\7f507466
+-Node: Delete\7f509085
+-Ref: Delete-Footnote-1\7f511837
+-Node: Multidimensional\7f511894
+-Node: Multiscanning\7f514989
+-Node: Arrays of Arrays\7f516580
+-Node: Arrays Summary\7f521347
+-Node: Functions\7f523440
+-Node: Built-in\7f524478
+-Node: Calling Built-in\7f525559
+-Node: Numeric Functions\7f527555
+-Ref: Numeric Functions-Footnote-1\7f531583
+-Ref: Numeric Functions-Footnote-2\7f531940
+-Ref: Numeric Functions-Footnote-3\7f531988
+-Node: String Functions\7f532260
+-Ref: String Functions-Footnote-1\7f555918
+-Ref: String Functions-Footnote-2\7f556046
+-Ref: String Functions-Footnote-3\7f556294
+-Node: Gory Details\7f556381
+-Ref: table-sub-escapes\7f558172
+-Ref: table-sub-proposed\7f559691
+-Ref: table-posix-sub\7f561054
+-Ref: table-gensub-escapes\7f562595
+-Ref: Gory Details-Footnote-1\7f563418
+-Node: I/O Functions\7f563572
+-Ref: table-system-return-values\7f570040
+-Ref: I/O Functions-Footnote-1\7f572020
+-Ref: I/O Functions-Footnote-2\7f572168
+-Node: Time Functions\7f572288
+-Ref: Time Functions-Footnote-1\7f582959
+-Ref: Time Functions-Footnote-2\7f583027
+-Ref: Time Functions-Footnote-3\7f583185
+-Ref: Time Functions-Footnote-4\7f583296
+-Ref: Time Functions-Footnote-5\7f583408
+-Ref: Time Functions-Footnote-6\7f583635
+-Node: Bitwise Functions\7f583901
+-Ref: table-bitwise-ops\7f584495
+-Ref: Bitwise Functions-Footnote-1\7f590540
+-Ref: Bitwise Functions-Footnote-2\7f590713
+-Node: Type Functions\7f590904
+-Node: I18N Functions\7f593655
+-Node: User-defined\7f595306
+-Node: Definition Syntax\7f596111
+-Ref: Definition Syntax-Footnote-1\7f601798
+-Node: Function Example\7f601869
+-Ref: Function Example-Footnote-1\7f604791
+-Node: Function Caveats\7f604813
+-Node: Calling A Function\7f605331
+-Node: Variable Scope\7f606289
+-Node: Pass By Value/Reference\7f609283
+-Node: Return Statement\7f612782
+-Node: Dynamic Typing\7f615761
+-Node: Indirect Calls\7f616691
+-Ref: Indirect Calls-Footnote-1\7f626943
+-Node: Functions Summary\7f627071
+-Node: Library Functions\7f629776
+-Ref: Library Functions-Footnote-1\7f633383
+-Ref: Library Functions-Footnote-2\7f633526
+-Node: Library Names\7f633697
+-Ref: Library Names-Footnote-1\7f637157
+-Ref: Library Names-Footnote-2\7f637380
+-Node: General Functions\7f637466
+-Node: Strtonum Function\7f638569
+-Node: Assert Function\7f641591
+-Node: Round Function\7f644917
+-Node: Cliff Random Function\7f646457
+-Node: Ordinal Functions\7f647473
+-Ref: Ordinal Functions-Footnote-1\7f650536
+-Ref: Ordinal Functions-Footnote-2\7f650788
+-Node: Join Function\7f650998
+-Ref: Join Function-Footnote-1\7f652768
+-Node: Getlocaltime Function\7f652968
+-Node: Readfile Function\7f656710
+-Node: Shell Quoting\7f658687
+-Node: Data File Management\7f660088
+-Node: Filetrans Function\7f660720
+-Node: Rewind Function\7f664816
+-Node: File Checking\7f666726
+-Ref: File Checking-Footnote-1\7f668060
+-Node: Empty Files\7f668261
+-Node: Ignoring Assigns\7f670240
+-Node: Getopt Function\7f671790
+-Ref: Getopt Function-Footnote-1\7f683259
+-Node: Passwd Functions\7f683459
+-Ref: Passwd Functions-Footnote-1\7f692298
+-Node: Group Functions\7f692386
+-Ref: Group Functions-Footnote-1\7f700284
+-Node: Walking Arrays\7f700491
+-Node: Library Functions Summary\7f703499
+-Node: Library Exercises\7f704905
+-Node: Sample Programs\7f705370
+-Node: Running Examples\7f706140
+-Node: Clones\7f706868
+-Node: Cut Program\7f708092
+-Node: Egrep Program\7f718021
+-Ref: Egrep Program-Footnote-1\7f725533
+-Node: Id Program\7f725643
+-Node: Split Program\7f729323
+-Ref: Split Program-Footnote-1\7f732781
+-Node: Tee Program\7f732910
+-Node: Uniq Program\7f735700
+-Node: Wc Program\7f743126
+-Ref: Wc Program-Footnote-1\7f747381
+-Node: Miscellaneous Programs\7f747475
+-Node: Dupword Program\7f748688
+-Node: Alarm Program\7f750718
+-Node: Translate Program\7f755573
+-Ref: Translate Program-Footnote-1\7f760138
+-Node: Labels Program\7f760408
+-Ref: Labels Program-Footnote-1\7f763759
+-Node: Word Sorting\7f763843
+-Node: History Sorting\7f767915
+-Node: Extract Program\7f769750
+-Node: Simple Sed\7f777280
+-Node: Igawk Program\7f780354
+-Ref: Igawk Program-Footnote-1\7f794685
+-Ref: Igawk Program-Footnote-2\7f794887
+-Ref: Igawk Program-Footnote-3\7f795009
+-Node: Anagram Program\7f795124
+-Node: Signature Program\7f798186
+-Node: Programs Summary\7f799433
+-Node: Programs Exercises\7f800647
+-Ref: Programs Exercises-Footnote-1\7f804776
+-Node: Advanced Features\7f804867
+-Node: Nondecimal Data\7f806857
+-Node: Array Sorting\7f808448
+-Node: Controlling Array Traversal\7f809148
+-Ref: Controlling Array Traversal-Footnote-1\7f817516
+-Node: Array Sorting Functions\7f817634
+-Ref: Array Sorting Functions-Footnote-1\7f822725
+-Node: Two-way I/O\7f822921
+-Ref: Two-way I/O-Footnote-1\7f829473
+-Ref: Two-way I/O-Footnote-2\7f829660
+-Node: TCP/IP Networking\7f829742
+-Node: Profiling\7f832860
+-Ref: Profiling-Footnote-1\7f841532
+-Node: Advanced Features Summary\7f841855
+-Node: Internationalization\7f843699
+-Node: I18N and L10N\7f845179
+-Node: Explaining gettext\7f845866
+-Ref: Explaining gettext-Footnote-1\7f851758
+-Ref: Explaining gettext-Footnote-2\7f851943
+-Node: Programmer i18n\7f852108
+-Ref: Programmer i18n-Footnote-1\7f857057
+-Node: Translator i18n\7f857106
+-Node: String Extraction\7f857900
+-Ref: String Extraction-Footnote-1\7f859032
+-Node: Printf Ordering\7f859118
+-Ref: Printf Ordering-Footnote-1\7f861904
+-Node: I18N Portability\7f861968
+-Ref: I18N Portability-Footnote-1\7f864424
+-Node: I18N Example\7f864487
+-Ref: I18N Example-Footnote-1\7f867293
+-Node: Gawk I18N\7f867366
+-Node: I18N Summary\7f868011
+-Node: Debugger\7f869352
+-Node: Debugging\7f870375
+-Node: Debugging Concepts\7f870816
+-Node: Debugging Terms\7f872625
+-Node: Awk Debugging\7f875200
+-Node: Sample Debugging Session\7f876106
+-Node: Debugger Invocation\7f876640
+-Node: Finding The Bug\7f878026
+-Node: List of Debugger Commands\7f884504
+-Node: Breakpoint Control\7f885837
+-Node: Debugger Execution Control\7f889531
+-Node: Viewing And Changing Data\7f892893
+-Node: Execution Stack\7f896267
+-Node: Debugger Info\7f897904
+-Node: Miscellaneous Debugger Commands\7f901975
+-Node: Readline Support\7f907037
+-Node: Limitations\7f907933
+-Node: Debugging Summary\7f910042
+-Node: Arbitrary Precision Arithmetic\7f911321
+-Node: Computer Arithmetic\7f912806
+-Ref: table-numeric-ranges\7f916572
+-Ref: table-floating-point-ranges\7f917065
+-Ref: Computer Arithmetic-Footnote-1\7f917723
+-Node: Math Definitions\7f917780
+-Ref: table-ieee-formats\7f921096
+-Ref: Math Definitions-Footnote-1\7f921699
+-Node: MPFR features\7f921804
+-Node: FP Math Caution\7f923522
+-Ref: FP Math Caution-Footnote-1\7f924594
+-Node: Inexactness of computations\7f924963
+-Node: Inexact representation\7f925923
+-Node: Comparing FP Values\7f927283
+-Node: Errors accumulate\7f928365
+-Node: Getting Accuracy\7f929798
+-Node: Try To Round\7f932508
+-Node: Setting precision\7f933407
+-Ref: table-predefined-precision-strings\7f934104
+-Node: Setting the rounding mode\7f935934
+-Ref: table-gawk-rounding-modes\7f936308
+-Ref: Setting the rounding mode-Footnote-1\7f940239
+-Node: Arbitrary Precision Integers\7f940418
+-Ref: Arbitrary Precision Integers-Footnote-1\7f943593
+-Node: Checking for MPFR\7f943742
+-Node: POSIX Floating Point Problems\7f945216
+-Ref: POSIX Floating Point Problems-Footnote-1\7f949087
+-Node: Floating point summary\7f949125
+-Node: Dynamic Extensions\7f951315
+-Node: Extension Intro\7f952868
+-Node: Plugin License\7f954134
+-Node: Extension Mechanism Outline\7f954931
+-Ref: figure-load-extension\7f955370
+-Ref: figure-register-new-function\7f956935
+-Ref: figure-call-new-function\7f958027
+-Node: Extension API Description\7f960089
+-Node: Extension API Functions Introduction\7f961731
+-Node: General Data Types\7f967271
+-Ref: General Data Types-Footnote-1\7f975632
+-Node: Memory Allocation Functions\7f975931
+-Ref: Memory Allocation Functions-Footnote-1\7f980141
+-Node: Constructor Functions\7f980240
+-Node: Registration Functions\7f983826
+-Node: Extension Functions\7f984511
+-Node: Exit Callback Functions\7f989726
+-Node: Extension Version String\7f990976
+-Node: Input Parsers\7f991639
+-Node: Output Wrappers\7f1004360
+-Node: Two-way processors\7f1008872
+-Node: Printing Messages\7f1011137
+-Ref: Printing Messages-Footnote-1\7f1012308
+-Node: Updating ERRNO\7f1012461
+-Node: Requesting Values\7f1013200
+-Ref: table-value-types-returned\7f1013937
+-Node: Accessing Parameters\7f1014873
+-Node: Symbol Table Access\7f1016108
+-Node: Symbol table by name\7f1016620
+-Node: Symbol table by cookie\7f1018409
+-Ref: Symbol table by cookie-Footnote-1\7f1022594
+-Node: Cached values\7f1022658
+-Ref: Cached values-Footnote-1\7f1026194
+-Node: Array Manipulation\7f1026347
+-Ref: Array Manipulation-Footnote-1\7f1027438
+-Node: Array Data Types\7f1027475
+-Ref: Array Data Types-Footnote-1\7f1030133
+-Node: Array Functions\7f1030225
+-Node: Flattening Arrays\7f1034723
+-Node: Creating Arrays\7f1041699
+-Node: Redirection API\7f1046466
+-Node: Extension API Variables\7f1049299
+-Node: Extension Versioning\7f1050010
+-Ref: gawk-api-version\7f1050439
+-Node: Extension GMP/MPFR Versioning\7f1052170
+-Node: Extension API Informational Variables\7f1053798
+-Node: Extension API Boilerplate\7f1054871
+-Node: Changes from API V1\7f1058845
+-Node: Finding Extensions\7f1060417
+-Node: Extension Example\7f1060976
+-Node: Internal File Description\7f1061774
+-Node: Internal File Ops\7f1065854
+-Ref: Internal File Ops-Footnote-1\7f1077204
+-Node: Using Internal File Ops\7f1077344
+-Ref: Using Internal File Ops-Footnote-1\7f1079727
+-Node: Extension Samples\7f1080001
+-Node: Extension Sample File Functions\7f1081530
+-Node: Extension Sample Fnmatch\7f1089179
+-Node: Extension Sample Fork\7f1090666
+-Node: Extension Sample Inplace\7f1091884
+-Node: Extension Sample Ord\7f1095101
+-Node: Extension Sample Readdir\7f1095937
+-Ref: table-readdir-file-types\7f1096826
+-Node: Extension Sample Revout\7f1097631
+-Node: Extension Sample Rev2way\7f1098220
+-Node: Extension Sample Read write array\7f1098960
+-Node: Extension Sample Readfile\7f1100902
+-Node: Extension Sample Time\7f1101997
+-Node: Extension Sample API Tests\7f1103345
+-Node: gawkextlib\7f1103837
+-Node: Extension summary\7f1106755
+-Node: Extension Exercises\7f1110457
+-Node: Language History\7f1111955
+-Node: V7/SVR3.1\7f1113611
+-Node: SVR4\7f1115763
+-Node: POSIX\7f1117197
+-Node: BTL\7f1118577
+-Node: POSIX/GNU\7f1119306
+-Node: Feature History\7f1125084
+-Node: Common Extensions\7f1140943
+-Node: Ranges and Locales\7f1142226
+-Ref: Ranges and Locales-Footnote-1\7f1146842
+-Ref: Ranges and Locales-Footnote-2\7f1146869
+-Ref: Ranges and Locales-Footnote-3\7f1147104
+-Node: Contributors\7f1147325
+-Node: History summary\7f1153270
+-Node: Installation\7f1154650
+-Node: Gawk Distribution\7f1155594
+-Node: Getting\7f1156078
+-Node: Extracting\7f1157041
+-Node: Distribution contents\7f1158679
+-Node: Unix Installation\7f1165159
+-Node: Quick Installation\7f1165841
+-Node: Shell Startup Files\7f1168255
+-Node: Additional Configuration Options\7f1169344
+-Node: Configuration Philosophy\7f1171637
+-Node: Non-Unix Installation\7f1174006
+-Node: PC Installation\7f1174466
+-Node: PC Binary Installation\7f1175304
+-Node: PC Compiling\7f1175739
+-Node: PC Using\7f1176856
+-Node: Cygwin\7f1180071
+-Node: MSYS\7f1181170
+-Node: VMS Installation\7f1181671
+-Node: VMS Compilation\7f1182462
+-Ref: VMS Compilation-Footnote-1\7f1183691
+-Node: VMS Dynamic Extensions\7f1183749
+-Node: VMS Installation Details\7f1185434
+-Node: VMS Running\7f1187687
+-Node: VMS GNV\7f1191966
+-Node: VMS Old Gawk\7f1192701
+-Node: Bugs\7f1193172
+-Node: Bug address\7f1193835
+-Node: Usenet\7f1196627
+-Node: Maintainers\7f1197404
+-Node: Other Versions\7f1198665
+-Node: Installation summary\7f1205427
+-Node: Notes\7f1206629
+-Node: Compatibility Mode\7f1207494
+-Node: Additions\7f1208276
+-Node: Accessing The Source\7f1209201
+-Node: Adding Code\7f1210638
+-Node: New Ports\7f1216857
+-Node: Derived Files\7f1221345
+-Ref: Derived Files-Footnote-1\7f1226991
+-Ref: Derived Files-Footnote-2\7f1227026
+-Ref: Derived Files-Footnote-3\7f1227624
+-Node: Future Extensions\7f1227738
+-Node: Implementation Limitations\7f1228396
+-Node: Extension Design\7f1229579
+-Node: Old Extension Problems\7f1230733
+-Ref: Old Extension Problems-Footnote-1\7f1232251
+-Node: Extension New Mechanism Goals\7f1232308
+-Ref: Extension New Mechanism Goals-Footnote-1\7f1235672
+-Node: Extension Other Design Decisions\7f1235861
+-Node: Extension Future Growth\7f1237974
+-Node: Old Extension Mechanism\7f1238810
+-Node: Notes summary\7f1240573
+-Node: Basic Concepts\7f1241755
+-Node: Basic High Level\7f1242436
+-Ref: figure-general-flow\7f1242718
+-Ref: figure-process-flow\7f1243403
+-Ref: Basic High Level-Footnote-1\7f1246704
+-Node: Basic Data Typing\7f1246889
+-Node: Glossary\7f1250217
+-Node: Copying\7f1282055
+-Node: GNU Free Documentation License\7f1319598
+-Node: Index\7f1344718
++Node: Format Modifiers\7f296985
++Node: Printf Examples\7f303000
++Node: Redirection\7f305486
++Node: Special FD\7f312327
++Ref: Special FD-Footnote-1\7f315495
++Node: Special Files\7f315569
++Node: Other Inherited Files\7f316186
++Node: Special Network\7f317187
++Node: Special Caveats\7f318047
++Node: Close Files And Pipes\7f318996
++Ref: table-close-pipe-return-values\7f325903
++Ref: Close Files And Pipes-Footnote-1\7f326716
++Ref: Close Files And Pipes-Footnote-2\7f326864
++Node: Nonfatal\7f327016
++Node: Output Summary\7f329354
++Node: Output Exercises\7f330576
++Node: Expressions\7f331255
++Node: Values\7f332443
++Node: Constants\7f333121
++Node: Scalar Constants\7f333812
++Ref: Scalar Constants-Footnote-1\7f334676
++Node: Nondecimal-numbers\7f334926
++Node: Regexp Constants\7f337927
++Node: Using Constant Regexps\7f338453
++Node: Standard Regexp Constants\7f339075
++Node: Strong Regexp Constants\7f342263
++Node: Variables\7f345221
++Node: Using Variables\7f345878
++Node: Assignment Options\7f347788
++Node: Conversion\7f349661
++Node: Strings And Numbers\7f350185
++Ref: Strings And Numbers-Footnote-1\7f353248
++Node: Locale influences conversions\7f353357
++Ref: table-locale-affects\7f356115
++Node: All Operators\7f356733
++Node: Arithmetic Ops\7f357362
++Node: Concatenation\7f359868
++Ref: Concatenation-Footnote-1\7f362715
++Node: Assignment Ops\7f362822
++Ref: table-assign-ops\7f367813
++Node: Increment Ops\7f369126
++Node: Truth Values and Conditions\7f372586
++Node: Truth Values\7f373660
++Node: Typing and Comparison\7f374708
++Node: Variable Typing\7f375528
++Ref: Variable Typing-Footnote-1\7f381991
++Ref: Variable Typing-Footnote-2\7f382063
++Node: Comparison Operators\7f382140
++Ref: table-relational-ops\7f382559
++Node: POSIX String Comparison\7f386054
++Ref: POSIX String Comparison-Footnote-1\7f387749
++Ref: POSIX String Comparison-Footnote-2\7f387888
++Node: Boolean Ops\7f387972
++Ref: Boolean Ops-Footnote-1\7f392454
++Node: Conditional Exp\7f392546
++Node: Function Calls\7f394282
++Node: Precedence\7f398159
++Node: Locales\7f401818
++Node: Expressions Summary\7f403450
++Node: Patterns and Actions\7f406023
++Node: Pattern Overview\7f407143
++Node: Regexp Patterns\7f408820
++Node: Expression Patterns\7f409362
++Node: Ranges\7f413143
++Node: BEGIN/END\7f416251
++Node: Using BEGIN/END\7f417012
++Ref: Using BEGIN/END-Footnote-1\7f419748
++Node: I/O And BEGIN/END\7f419854
++Node: BEGINFILE/ENDFILE\7f422168
++Node: Empty\7f425081
++Node: Using Shell Variables\7f425398
++Node: Action Overview\7f427672
++Node: Statements\7f429997
++Node: If Statement\7f431845
++Node: While Statement\7f433340
++Node: Do Statement\7f435368
++Node: For Statement\7f436516
++Node: Switch Statement\7f439687
++Node: Break Statement\7f442073
++Node: Continue Statement\7f444165
++Node: Next Statement\7f445992
++Node: Nextfile Statement\7f448375
++Node: Exit Statement\7f451027
++Node: Built-in Variables\7f453430
++Node: User-modified\7f454563
++Node: Auto-set\7f462330
++Ref: Auto-set-Footnote-1\7f478629
++Ref: Auto-set-Footnote-2\7f478835
++Node: ARGC and ARGV\7f478891
++Node: Pattern Action Summary\7f483104
++Node: Arrays\7f485534
++Node: Array Basics\7f486863
++Node: Array Intro\7f487707
++Ref: figure-array-elements\7f489682
++Ref: Array Intro-Footnote-1\7f492386
++Node: Reference to Elements\7f492514
++Node: Assigning Elements\7f494978
++Node: Array Example\7f495469
++Node: Scanning an Array\7f497228
++Node: Controlling Scanning\7f500250
++Ref: Controlling Scanning-Footnote-1\7f505649
++Node: Numeric Array Subscripts\7f505965
++Node: Uninitialized Subscripts\7f508149
++Node: Delete\7f509768
++Ref: Delete-Footnote-1\7f512520
++Node: Multidimensional\7f512577
++Node: Multiscanning\7f515672
++Node: Arrays of Arrays\7f517263
++Node: Arrays Summary\7f522030
++Node: Functions\7f524123
++Node: Built-in\7f525161
++Node: Calling Built-in\7f526242
++Node: Numeric Functions\7f528238
++Ref: Numeric Functions-Footnote-1\7f532266
++Ref: Numeric Functions-Footnote-2\7f532623
++Ref: Numeric Functions-Footnote-3\7f532671
++Node: String Functions\7f532943
++Ref: String Functions-Footnote-1\7f556601
++Ref: String Functions-Footnote-2\7f556729
++Ref: String Functions-Footnote-3\7f556977
++Node: Gory Details\7f557064
++Ref: table-sub-escapes\7f558855
++Ref: table-sub-proposed\7f560374
++Ref: table-posix-sub\7f561737
++Ref: table-gensub-escapes\7f563278
++Ref: Gory Details-Footnote-1\7f564101
++Node: I/O Functions\7f564255
++Ref: table-system-return-values\7f570723
++Ref: I/O Functions-Footnote-1\7f572703
++Ref: I/O Functions-Footnote-2\7f572851
++Node: Time Functions\7f572971
++Ref: Time Functions-Footnote-1\7f583642
++Ref: Time Functions-Footnote-2\7f583710
++Ref: Time Functions-Footnote-3\7f583868
++Ref: Time Functions-Footnote-4\7f583979
++Ref: Time Functions-Footnote-5\7f584091
++Ref: Time Functions-Footnote-6\7f584318
++Node: Bitwise Functions\7f584584
++Ref: table-bitwise-ops\7f585178
++Ref: Bitwise Functions-Footnote-1\7f591223
++Ref: Bitwise Functions-Footnote-2\7f591396
++Node: Type Functions\7f591587
++Node: I18N Functions\7f594338
++Node: User-defined\7f595989
++Node: Definition Syntax\7f596794
++Ref: Definition Syntax-Footnote-1\7f602481
++Node: Function Example\7f602552
++Ref: Function Example-Footnote-1\7f605474
++Node: Function Caveats\7f605496
++Node: Calling A Function\7f606014
++Node: Variable Scope\7f606972
++Node: Pass By Value/Reference\7f609966
++Node: Return Statement\7f613465
++Node: Dynamic Typing\7f616444
++Node: Indirect Calls\7f617374
++Ref: Indirect Calls-Footnote-1\7f627626
++Node: Functions Summary\7f627754
++Node: Library Functions\7f630459
++Ref: Library Functions-Footnote-1\7f634066
++Ref: Library Functions-Footnote-2\7f634209
++Node: Library Names\7f634380
++Ref: Library Names-Footnote-1\7f637840
++Ref: Library Names-Footnote-2\7f638063
++Node: General Functions\7f638149
++Node: Strtonum Function\7f639252
++Node: Assert Function\7f642274
++Node: Round Function\7f645600
++Node: Cliff Random Function\7f647140
++Node: Ordinal Functions\7f648156
++Ref: Ordinal Functions-Footnote-1\7f651219
++Ref: Ordinal Functions-Footnote-2\7f651471
++Node: Join Function\7f651681
++Ref: Join Function-Footnote-1\7f653451
++Node: Getlocaltime Function\7f653651
++Node: Readfile Function\7f657393
++Node: Shell Quoting\7f659370
++Node: Data File Management\7f660771
++Node: Filetrans Function\7f661403
++Node: Rewind Function\7f665499
++Node: File Checking\7f667409
++Ref: File Checking-Footnote-1\7f668743
++Node: Empty Files\7f668944
++Node: Ignoring Assigns\7f670923
++Node: Getopt Function\7f672473
++Ref: Getopt Function-Footnote-1\7f683942
++Node: Passwd Functions\7f684142
++Ref: Passwd Functions-Footnote-1\7f692981
++Node: Group Functions\7f693069
++Ref: Group Functions-Footnote-1\7f700967
++Node: Walking Arrays\7f701174
++Node: Library Functions Summary\7f704182
++Node: Library Exercises\7f705588
++Node: Sample Programs\7f706053
++Node: Running Examples\7f706823
++Node: Clones\7f707551
++Node: Cut Program\7f708775
++Node: Egrep Program\7f718704
++Ref: Egrep Program-Footnote-1\7f726216
++Node: Id Program\7f726326
++Node: Split Program\7f730006
++Ref: Split Program-Footnote-1\7f733464
++Node: Tee Program\7f733593
++Node: Uniq Program\7f736383
++Node: Wc Program\7f743809
++Ref: Wc Program-Footnote-1\7f748064
++Node: Miscellaneous Programs\7f748158
++Node: Dupword Program\7f749371
++Node: Alarm Program\7f751401
++Node: Translate Program\7f756256
++Ref: Translate Program-Footnote-1\7f760821
++Node: Labels Program\7f761091
++Ref: Labels Program-Footnote-1\7f764442
++Node: Word Sorting\7f764526
++Node: History Sorting\7f768598
++Node: Extract Program\7f770433
++Node: Simple Sed\7f777963
++Node: Igawk Program\7f781037
++Ref: Igawk Program-Footnote-1\7f795368
++Ref: Igawk Program-Footnote-2\7f795570
++Ref: Igawk Program-Footnote-3\7f795692
++Node: Anagram Program\7f795807
++Node: Signature Program\7f798869
++Node: Programs Summary\7f800116
++Node: Programs Exercises\7f801330
++Ref: Programs Exercises-Footnote-1\7f805459
++Node: Advanced Features\7f805550
++Node: Nondecimal Data\7f807540
++Node: Array Sorting\7f809131
++Node: Controlling Array Traversal\7f809831
++Ref: Controlling Array Traversal-Footnote-1\7f818199
++Node: Array Sorting Functions\7f818317
++Ref: Array Sorting Functions-Footnote-1\7f823408
++Node: Two-way I/O\7f823604
++Ref: Two-way I/O-Footnote-1\7f830156
++Ref: Two-way I/O-Footnote-2\7f830343
++Node: TCP/IP Networking\7f830425
++Node: Profiling\7f833543
++Ref: Profiling-Footnote-1\7f842215
++Node: Advanced Features Summary\7f842538
++Node: Internationalization\7f844382
++Node: I18N and L10N\7f845862
++Node: Explaining gettext\7f846549
++Ref: Explaining gettext-Footnote-1\7f852441
++Ref: Explaining gettext-Footnote-2\7f852626
++Node: Programmer i18n\7f852791
++Ref: Programmer i18n-Footnote-1\7f857740
++Node: Translator i18n\7f857789
++Node: String Extraction\7f858583
++Ref: String Extraction-Footnote-1\7f859715
++Node: Printf Ordering\7f859801
++Ref: Printf Ordering-Footnote-1\7f862587
++Node: I18N Portability\7f862651
++Ref: I18N Portability-Footnote-1\7f865107
++Node: I18N Example\7f865170
++Ref: I18N Example-Footnote-1\7f867976
++Node: Gawk I18N\7f868049
++Node: I18N Summary\7f868694
++Node: Debugger\7f870035
++Node: Debugging\7f871058
++Node: Debugging Concepts\7f871499
++Node: Debugging Terms\7f873308
++Node: Awk Debugging\7f875883
++Node: Sample Debugging Session\7f876789
++Node: Debugger Invocation\7f877323
++Node: Finding The Bug\7f878709
++Node: List of Debugger Commands\7f885187
++Node: Breakpoint Control\7f886520
++Node: Debugger Execution Control\7f890214
++Node: Viewing And Changing Data\7f893576
++Node: Execution Stack\7f896950
++Node: Debugger Info\7f898587
++Node: Miscellaneous Debugger Commands\7f902658
++Node: Readline Support\7f907720
++Node: Limitations\7f908616
++Node: Debugging Summary\7f910725
++Node: Arbitrary Precision Arithmetic\7f912004
++Node: Computer Arithmetic\7f913489
++Ref: table-numeric-ranges\7f917255
++Ref: table-floating-point-ranges\7f917748
++Ref: Computer Arithmetic-Footnote-1\7f918406
++Node: Math Definitions\7f918463
++Ref: table-ieee-formats\7f921779
++Ref: Math Definitions-Footnote-1\7f922382
++Node: MPFR features\7f922487
++Node: FP Math Caution\7f924205
++Ref: FP Math Caution-Footnote-1\7f925277
++Node: Inexactness of computations\7f925646
++Node: Inexact representation\7f926606
++Node: Comparing FP Values\7f927966
++Node: Errors accumulate\7f929048
++Node: Getting Accuracy\7f930481
++Node: Try To Round\7f933191
++Node: Setting precision\7f934090
++Ref: table-predefined-precision-strings\7f934787
++Node: Setting the rounding mode\7f936617
++Ref: table-gawk-rounding-modes\7f936991
++Ref: Setting the rounding mode-Footnote-1\7f940922
++Node: Arbitrary Precision Integers\7f941101
++Ref: Arbitrary Precision Integers-Footnote-1\7f944276
++Node: Checking for MPFR\7f944425
++Node: POSIX Floating Point Problems\7f945899
++Ref: POSIX Floating Point Problems-Footnote-1\7f949770
++Node: Floating point summary\7f949808
++Node: Dynamic Extensions\7f951998
++Node: Extension Intro\7f953551
++Node: Plugin License\7f954817
++Node: Extension Mechanism Outline\7f955614
++Ref: figure-load-extension\7f956053
++Ref: figure-register-new-function\7f957618
++Ref: figure-call-new-function\7f958710
++Node: Extension API Description\7f960772
++Node: Extension API Functions Introduction\7f962414
++Node: General Data Types\7f967954
++Ref: General Data Types-Footnote-1\7f976315
++Node: Memory Allocation Functions\7f976614
++Ref: Memory Allocation Functions-Footnote-1\7f980824
++Node: Constructor Functions\7f980923
++Node: Registration Functions\7f984509
++Node: Extension Functions\7f985194
++Node: Exit Callback Functions\7f990409
++Node: Extension Version String\7f991659
++Node: Input Parsers\7f992322
++Node: Output Wrappers\7f1005043
++Node: Two-way processors\7f1009555
++Node: Printing Messages\7f1011820
++Ref: Printing Messages-Footnote-1\7f1012991
++Node: Updating ERRNO\7f1013144
++Node: Requesting Values\7f1013883
++Ref: table-value-types-returned\7f1014620
++Node: Accessing Parameters\7f1015556
++Node: Symbol Table Access\7f1016791
++Node: Symbol table by name\7f1017303
++Node: Symbol table by cookie\7f1019092
++Ref: Symbol table by cookie-Footnote-1\7f1023277
++Node: Cached values\7f1023341
++Ref: Cached values-Footnote-1\7f1026877
++Node: Array Manipulation\7f1027030
++Ref: Array Manipulation-Footnote-1\7f1028121
++Node: Array Data Types\7f1028158
++Ref: Array Data Types-Footnote-1\7f1030816
++Node: Array Functions\7f1030908
++Node: Flattening Arrays\7f1035406
++Node: Creating Arrays\7f1042382
++Node: Redirection API\7f1047149
++Node: Extension API Variables\7f1049982
++Node: Extension Versioning\7f1050693
++Ref: gawk-api-version\7f1051122
++Node: Extension GMP/MPFR Versioning\7f1052853
++Node: Extension API Informational Variables\7f1054481
++Node: Extension API Boilerplate\7f1055554
++Node: Changes from API V1\7f1059528
++Node: Finding Extensions\7f1061100
++Node: Extension Example\7f1061659
++Node: Internal File Description\7f1062457
++Node: Internal File Ops\7f1066537
++Ref: Internal File Ops-Footnote-1\7f1077887
++Node: Using Internal File Ops\7f1078027
++Ref: Using Internal File Ops-Footnote-1\7f1080410
++Node: Extension Samples\7f1080684
++Node: Extension Sample File Functions\7f1082213
++Node: Extension Sample Fnmatch\7f1089862
++Node: Extension Sample Fork\7f1091349
++Node: Extension Sample Inplace\7f1092567
++Node: Extension Sample Ord\7f1095784
++Node: Extension Sample Readdir\7f1096620
++Ref: table-readdir-file-types\7f1097509
++Node: Extension Sample Revout\7f1098314
++Node: Extension Sample Rev2way\7f1098903
++Node: Extension Sample Read write array\7f1099643
++Node: Extension Sample Readfile\7f1101585
++Node: Extension Sample Time\7f1102680
++Node: Extension Sample API Tests\7f1104028
++Node: gawkextlib\7f1104520
++Node: Extension summary\7f1107438
++Node: Extension Exercises\7f1111140
++Node: Language History\7f1112638
++Node: V7/SVR3.1\7f1114294
++Node: SVR4\7f1116446
++Node: POSIX\7f1117880
++Node: BTL\7f1119260
++Node: POSIX/GNU\7f1119989
++Node: Feature History\7f1125767
++Node: Common Extensions\7f1141626
++Node: Ranges and Locales\7f1142909
++Ref: Ranges and Locales-Footnote-1\7f1147525
++Ref: Ranges and Locales-Footnote-2\7f1147552
++Ref: Ranges and Locales-Footnote-3\7f1147787
++Node: Contributors\7f1148008
++Node: History summary\7f1153953
++Node: Installation\7f1155333
++Node: Gawk Distribution\7f1156277
++Node: Getting\7f1156761
++Node: Extracting\7f1157724
++Node: Distribution contents\7f1159362
++Node: Unix Installation\7f1165842
++Node: Quick Installation\7f1166524
++Node: Shell Startup Files\7f1168938
++Node: Additional Configuration Options\7f1170027
++Node: Configuration Philosophy\7f1172320
++Node: Non-Unix Installation\7f1174689
++Node: PC Installation\7f1175149
++Node: PC Binary Installation\7f1175987
++Node: PC Compiling\7f1176422
++Node: PC Using\7f1177539
++Node: Cygwin\7f1180754
++Node: MSYS\7f1181853
++Node: VMS Installation\7f1182354
++Node: VMS Compilation\7f1183145
++Ref: VMS Compilation-Footnote-1\7f1184374
++Node: VMS Dynamic Extensions\7f1184432
++Node: VMS Installation Details\7f1186117
++Node: VMS Running\7f1188370
++Node: VMS GNV\7f1192649
++Node: VMS Old Gawk\7f1193384
++Node: Bugs\7f1193855
++Node: Bug address\7f1194518
++Node: Usenet\7f1197310
++Node: Maintainers\7f1198087
++Node: Other Versions\7f1199348
++Node: Installation summary\7f1206110
++Node: Notes\7f1207312
++Node: Compatibility Mode\7f1208177
++Node: Additions\7f1208959
++Node: Accessing The Source\7f1209884
++Node: Adding Code\7f1211321
++Node: New Ports\7f1217540
++Node: Derived Files\7f1222028
++Ref: Derived Files-Footnote-1\7f1227674
++Ref: Derived Files-Footnote-2\7f1227709
++Ref: Derived Files-Footnote-3\7f1228307
++Node: Future Extensions\7f1228421
++Node: Implementation Limitations\7f1229079
++Node: Extension Design\7f1230262
++Node: Old Extension Problems\7f1231416
++Ref: Old Extension Problems-Footnote-1\7f1232934
++Node: Extension New Mechanism Goals\7f1232991
++Ref: Extension New Mechanism Goals-Footnote-1\7f1236355
++Node: Extension Other Design Decisions\7f1236544
++Node: Extension Future Growth\7f1238657
++Node: Old Extension Mechanism\7f1239493
++Node: Notes summary\7f1241256
++Node: Basic Concepts\7f1242438
++Node: Basic High Level\7f1243119
++Ref: figure-general-flow\7f1243401
++Ref: figure-process-flow\7f1244086
++Ref: Basic High Level-Footnote-1\7f1247387
++Node: Basic Data Typing\7f1247572
++Node: Glossary\7f1250900
++Node: Copying\7f1282738
++Node: GNU Free Documentation License\7f1320281
++Node: Index\7f1345401
\1f
+ End Tag Table
+diff --git a/doc/gawk.texi b/doc/gawk.texi
+index 7b69b52..7dfa3b3 100644
+--- a/doc/gawk.texi
++++ b/doc/gawk.texi
+@@ -9557,6 +9557,25 @@ the field width.  Here is a list of the format-control letters:
+ @c @asis for docbook to come out right
+ @table @asis
++@item @code{%a}, @code{%A}
++A floating point number of the form
++[@code{-}]@code{0x@var{h}.@var{hhhh}p+-@var{dd}}
++(C99 hexadecimal floating point format).
++For @code{%A},
++uppercase letters are used instead of lowercase ones.
++
++@quotation NOTE
++While the current POSIX standard requires support for @code{%a}
++and @code{%A} in @command{awk}, as far as we know, no other version
++of @command{awk} actually implements it.  It's use is thus highly
++nonportable!
++
++Furthermore, these formats are not available on any system where the
++underlying C library @code{printf()} function does not support them. As
++of this writing, among current systems, only OpenVMS is known to not
++support them.
++@end quotation
++
+ @item @code{%c}
+ Print a number as a character; thus, @samp{printf "%c",
+ 65} outputs the letter @samp{A}. The output for a string value is
+diff --git a/doc/gawktexi.in b/doc/gawktexi.in
+index 6203e1a..f2cb710 100644
+--- a/doc/gawktexi.in
++++ b/doc/gawktexi.in
+@@ -9156,6 +9156,25 @@ the field width.  Here is a list of the format-control letters:
+ @c @asis for docbook to come out right
+ @table @asis
++@item @code{%a}, @code{%A}
++A floating point number of the form
++[@code{-}]@code{0x@var{h}.@var{hhhh}p+-@var{dd}}
++(C99 hexadecimal floating point format).
++For @code{%A},
++uppercase letters are used instead of lowercase ones.
++
++@quotation NOTE
++While the current POSIX standard requires support for @code{%a}
++and @code{%A} in @command{awk}, as far as we know, no other version
++of @command{awk} actually implements it.  It's use is thus highly
++nonportable!
++
++Furthermore, these formats are not available on any system where the
++underlying C library @code{printf()} function does not support them. As
++of this writing, among current systems, only OpenVMS is known to not
++support them.
++@end quotation
++
+ @item @code{%c}
+ Print a number as a character; thus, @samp{printf "%c",
+ 65} outputs the letter @samp{A}. The output for a string value is
+diff --git a/doc/wordlist b/doc/wordlist
+index 3c3c7e9..3763056 100644
+--- a/doc/wordlist
++++ b/doc/wordlist
+@@ -865,6 +865,7 @@ dayname
+ db
+ dcgettext
+ dcngettext
++dd
+ ddd
+ de
+ deallocations
+@@ -1132,6 +1133,7 @@ helpfull
+ helplib
+ hfil
+ hh
++hhhh
+ hhob
+ histsort
+ hlp
+diff --git a/doc/wordlist2 b/doc/wordlist2
+index 9275fdb..7bf7ad3 100644
+--- a/doc/wordlist2
++++ b/doc/wordlist2
+@@ -60,6 +60,7 @@ distclean
+ docbook
+ du
+ dvi
++elled
+ emph
+ en
+ env
+diff --git a/pc/config.h b/pc/config.h
+index de2b7ec..2ec5352 100644
+--- a/pc/config.h
++++ b/pc/config.h
+@@ -473,6 +473,9 @@
+ /* Define to the version of this package. */
+ #define PACKAGE_VERSION "4.2.1"
++/* Define to 1 if *printf supports %a format */
++#define PRINTF_HAS_A_FORMAT 1
++
+ /* Define to 1 if *printf supports %F format */
+ #ifdef __DJGPP__
+ #define PRINTF_HAS_F_FORMAT 1
+diff --git a/pc/config.sed b/pc/config.sed
+index 5b3cc32..a7ba878 100644
+--- a/pc/config.sed
++++ b/pc/config.sed
+@@ -273,6 +273,8 @@ s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
+ #ifdef __DJGPP__\
+ #define HAVE__BOOL 1\
+ #endif
++/^#undef PRINTF_HAS_A_FORMAT *$/c\
++#define PRINTF_HAS_A_FORMAT 1
+ /^#undef PRINTF_HAS_F_FORMAT *$/c\
+ #ifdef __DJGPP__\
+ #define PRINTF_HAS_F_FORMAT 1\
+-- 
+2.14.4
+
diff --git a/gawk-4.2.1-001-remove-the-tail-recursion-optimization.patch b/gawk-4.2.1-001-remove-the-tail-recursion-optimization.patch
new file mode 100644 (file)
index 0000000..0063c28
--- /dev/null
@@ -0,0 +1,309 @@
+From 47316d294571673a8dbf1e9e435893e2660f46a8 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <arnold@skeeve.com>
+Date: Mon, 26 Mar 2018 10:45:01 +0300
+Subject: [PATCH] Remove the tail recursion optimization.
+
+---
+ awk.h                |  4 ----
+ awkgram.y            | 27 ++-------------------------
+ eval.c               | 49 +++++++------------------------------------------
+ test/Makefile.am     |  4 +++-
+ test/Makefile.in     |  9 ++++++++-
+ test/Maketests       |  5 +++++
+ test/tailrecurse.awk | 15 +++++++++++++++
+ test/tailrecurse.ok  |  5 +++++
+ 8 files changed, 45 insertions(+), 73 deletions(-)
+ create mode 100644 test/tailrecurse.awk
+ create mode 100644 test/tailrecurse.ok
+
+diff --git a/awk.h b/awk.h
+index 3b351c2..36e71f2 100644
+--- a/awk.h
++++ b/awk.h
+@@ -527,7 +527,6 @@ typedef struct exp_node {
+ #define func_node    sub.nodep.x.extra
+ #define prev_frame_size       sub.nodep.reflags
+ #define reti         sub.nodep.l.li
+-#define num_tail_calls    sub.nodep.cnt
+ /* Node_var: */
+ #define var_value    lnode
+@@ -862,9 +861,6 @@ typedef struct exp_instruction {
+ /* Op_func_call, Op_func */
+ #define func_body       x.xn
+-/* Op_func_call */
+-#define tail_call     d.dl
+-
+ /* Op_subscript */
+ #define sub_count       d.dl
+diff --git a/awkgram.y b/awkgram.y
+index ad830a5..caed09e 100644
+--- a/awkgram.y
++++ b/awkgram.y
+@@ -993,20 +993,9 @@ non_compound_stmt
+                       $$ = list_create($1);
+                       (void) list_prepend($$, instruction(Op_push_i));
+                       $$->nexti->memory = dupnode(Nnull_string);
+-              } else {
+-                      if (do_optimize
+-                              && $3->lasti->opcode == Op_func_call
+-                              && strcmp($3->lasti->func_name, in_function) == 0
+-                      ) {
+-                              /* Do tail recursion optimization. Tail
+-                               * call without a return value is recognized
+-                               * in mk_function().
+-                               */
+-                              ($3->lasti + 1)->tail_call = true;
+-                      }
+-
++              } else
+                       $$ = list_append($3, $1);
+-              }
++
+               $$ = add_pending_comment($$);
+         }
+       | simple_stmt statement_term
+@@ -4736,18 +4725,6 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
+       thisfunc = fi->func_body;
+       assert(thisfunc != NULL);
+-      if (do_optimize && def->lasti->opcode == Op_pop) {
+-              /* tail call which does not return any value. */
+-
+-              INSTRUCTION *t;
+-
+-              for (t = def->nexti; t->nexti != def->lasti; t = t->nexti)
+-                      ;
+-              if (t->opcode == Op_func_call
+-                  && strcmp(t->func_name, thisfunc->vname) == 0)
+-                      (t + 1)->tail_call = true;
+-      }
+-
+       /* add any pre-function comment to start of action for profile.c  */
+       if (function_comment != NULL) {
+diff --git a/eval.c b/eval.c
+index 6ece236..34ba174 100644
+--- a/eval.c
++++ b/eval.c
+@@ -674,7 +674,7 @@ void
+ dump_fcall_stack(FILE *fp)
+ {
+       NODE *f, *func;
+-      long i = 0, j, k = 0;
++      long i = 0, k = 0;
+       if (fcall_count == 0)
+               return;
+@@ -682,15 +682,13 @@ dump_fcall_stack(FILE *fp)
+       /* current frame */
+       func = frame_ptr->func_node;
+-      for (j = 0; j <= frame_ptr->num_tail_calls; j++)
+-              fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
++      fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
+       /* outer frames except main */
+       for (i = 1; i < fcall_count; i++) {
+               f = fcall_list[i];
+               func = f->func_node;
+-              for (j = 0; j <= f->num_tail_calls; j++)
+-                      fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
++              fprintf(fp, "\t# %3ld. %s\n", k++, func->vname);
+       }
+       fprintf(fp, "\t# %3ld. -- main --\n", k);
+@@ -1242,38 +1240,16 @@ setup_frame(INSTRUCTION *pc)
+       NODE *m, *f, *fp;
+       NODE **sp = NULL;
+       int pcount, arg_count, i, j;
+-      bool tail_optimize = false;
+       f = pc->func_body;
+       pcount = f->param_cnt;
+       fp = f->fparms;
+       arg_count = (pc + 1)->expr_count;
+-      /* tail recursion optimization */
+-      tail_optimize =  ((pc + 1)->tail_call && do_optimize
+-                              && ! do_debug && ! do_profile);
+-
+-      if (tail_optimize) {
+-              /* free local vars of calling frame */
+-
+-              NODE *func;
+-              int n;
+-
+-              func = frame_ptr->func_node;
+-              for (n = func->param_cnt, sp = frame_ptr->stack; n > 0; n--) {
+-                      r = *sp++;
+-                      if (r->type == Node_var)     /* local variable */
+-                              DEREF(r->var_value);
+-                      else if (r->type == Node_var_array)     /* local array */
+-                              assoc_clear(r);
+-              }
+-              sp = frame_ptr->stack;
+-
+-      } else if (pcount > 0) {
++      if (pcount > 0) {
+               ezalloc(sp, NODE **, pcount * sizeof(NODE *), "setup_frame");
+       }
+-
+       /* check for extra args */
+       if (arg_count > pcount) {
+               warning(
+@@ -1287,13 +1263,9 @@ setup_frame(INSTRUCTION *pc)
+       }
+       for (i = 0, j = arg_count - 1; i < pcount; i++, j--) {
+-              if (tail_optimize)
+-                      r = sp[i];
+-              else {
+-                      getnode(r);
+-                      memset(r, 0, sizeof(NODE));
+-                      sp[i] = r;
+-              }
++              getnode(r);
++              memset(r, 0, sizeof(NODE));
++              sp[i] = r;
+               if (i >= arg_count) {
+                       /* local variable */
+@@ -1348,11 +1320,6 @@ setup_frame(INSTRUCTION *pc)
+       stack_adj(-arg_count);  /* adjust stack pointer */
+-      if (tail_optimize) {
+-              frame_ptr->num_tail_calls++;
+-              return f->code_ptr;
+-      }
+-
+       if (pc->opcode == Op_indirect_func_call) {
+               r = POP();      /* indirect var */
+               DEREF(r);
+@@ -1372,7 +1339,6 @@ setup_frame(INSTRUCTION *pc)
+       frame_ptr->stack = sp;
+       frame_ptr->prev_frame_size = (stack_ptr - stack_bottom); /* size of the previous stack frame */
+       frame_ptr->func_node = f;
+-      frame_ptr->num_tail_calls = 0;
+       frame_ptr->vname = NULL;
+       frame_ptr->reti = pc; /* on return execute pc->nexti */
+@@ -1774,7 +1740,6 @@ init_interpret()
+       frame_ptr->type = Node_frame;
+       frame_ptr->stack = NULL;
+       frame_ptr->func_node = NULL;    /* in main */
+-      frame_ptr->num_tail_calls = 0;
+       frame_ptr->vname = NULL;
+       /* initialize true and false nodes */
+diff --git a/test/Makefile.am b/test/Makefile.am
+index bf1dbd3..40e25b2 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -1134,6 +1134,8 @@ EXTRA_DIST = \
+       synerr1.ok \
+       synerr2.awk \
+       synerr2.ok \
++      tailrecurse.awk \
++      tailrecurse.ok \
+       testext.ok \
+       time.awk \
+       time.ok \
+@@ -1253,7 +1255,7 @@ BASIC_TESTS = \
+       sigpipe1 sortempty sortglos splitargv splitarr \
+       splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \
+       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 \
+-      tradanch tweakfld \
++      tailrecurse tradanch tweakfld \
+       uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \
+       wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
+       zero2 zeroe0 zeroflag
+diff --git a/test/Makefile.in b/test/Makefile.in
+index f96151b..74405f8 100644
+--- a/test/Makefile.in
++++ b/test/Makefile.in
+@@ -1392,6 +1392,8 @@ EXTRA_DIST = \
+       synerr1.ok \
+       synerr2.awk \
+       synerr2.ok \
++      tailrecurse.awk \
++      tailrecurse.ok \
+       testext.ok \
+       time.awk \
+       time.ok \
+@@ -1510,7 +1512,7 @@ BASIC_TESTS = \
+       sigpipe1 sortempty sortglos splitargv splitarr \
+       splitdef splitvar splitwht status-close strcat1 strnum1 strnum2 strtod \
+       subamp subback subi18n subsepnm subslash substr swaplns synerr1 synerr2 \
+-      tradanch tweakfld \
++      tailrecurse tradanch tweakfld \
+       uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs uplus \
+       wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
+       zero2 zeroe0 zeroflag
+@@ -3919,6 +3921,11 @@ synerr2:
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++tailrecurse:
++      @echo $@
++      @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
++      @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++
+ uninit2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+diff --git a/test/Maketests b/test/Maketests
+index e449dd3..4a90e3e 100644
+--- a/test/Maketests
++++ b/test/Maketests
+@@ -1002,6 +1002,11 @@ synerr2:
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++tailrecurse:
++      @echo $@
++      @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
++      @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++
+ uninit2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+diff --git a/test/tailrecurse.awk b/test/tailrecurse.awk
+new file mode 100644
+index 0000000..b287d16
+--- /dev/null
++++ b/test/tailrecurse.awk
+@@ -0,0 +1,15 @@
++BEGIN {
++      abc(2)
++}
++
++
++function abc(c, A, B)
++{
++      print "abc(" c ", " length(A) ")"
++      if (! c--) {
++              return 
++      }
++      B[""]
++      print length(B)
++      return abc(c, B)
++}
+diff --git a/test/tailrecurse.ok b/test/tailrecurse.ok
+new file mode 100644
+index 0000000..73ce1ed
+--- /dev/null
++++ b/test/tailrecurse.ok
+@@ -0,0 +1,5 @@
++abc(2, 0)
++1
++abc(1, 1)
++1
++abc(0, 1)
+-- 
+2.14.4
+
diff --git a/gawk-4.2.1-002-copy-MPZ-MPFR-bits-also-in-r_dupnode.patch b/gawk-4.2.1-002-copy-MPZ-MPFR-bits-also-in-r_dupnode.patch
new file mode 100644 (file)
index 0000000..af71827
--- /dev/null
@@ -0,0 +1,208 @@
+From 0fafaee9bb38a3ea4b8be4009e9ce99334460ddd Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <arnold@skeeve.com>
+Date: Mon, 2 Apr 2018 16:37:17 +0300
+Subject: [PATCH] Copy MPZ/MPFR bits also, in r_dupnode.
+
+---
+ interpret.h        | 27 ++++++++++++++++++---------
+ node.c             | 20 ++++++++++++++++++--
+ test/Makefile.am   | 12 ++++++++++--
+ test/Makefile.in   | 12 ++++++++++--
+ test/mpfrfield.awk | 14 ++++++++++++++
+ test/mpfrfield.in  | 10 ++++++++++
+ test/mpfrfield.ok  |  1 +
+ 7 files changed, 81 insertions(+), 15 deletions(-)
+ create mode 100644 test/mpfrfield.awk
+ create mode 100644 test/mpfrfield.in
+ create mode 100644 test/mpfrfield.ok
+
+diff --git a/interpret.h b/interpret.h
+index 96e2c89..20fcb7a 100644
+--- a/interpret.h
++++ b/interpret.h
+@@ -32,16 +32,25 @@
+  * valref 1, that effectively means that this is an assignment like "$n = $n",
+  * so a no-op, other than triggering $0 reconstitution.
+  */
+-#define UNFIELD(l, r) \
+-{ \
+-      /* if was a field, turn it into a var */ \
+-      if ((r->flags & MALLOC) != 0 || r->valref == 1) { \
+-              l = r; \
+-      } else { \
+-              l = dupnode(r); \
+-              DEREF(r); \
+-      } \
++
++// not a macro so we can step into it with a debugger
++#ifndef UNFIELD_DEFINED
++#define UNFIELD_DEFINED 1
++static inline void
++unfield(NODE **l, NODE **r)
++{
++      /* if was a field, turn it into a var */
++      if (((*r)->flags & MALLOC) != 0 || (*r)->valref == 1) {
++              (*l) = (*r);
++      } else {
++              (*l) = dupnode(*r);
++              DEREF(*r);
++      }
+ }
++
++#define UNFIELD(l, r) unfield(& (l), & (r))
++#endif
++
+ int
+ r_interpret(INSTRUCTION *code)
+ {
+diff --git a/node.c b/node.c
+index add959f..fcd2bf3 100644
+--- a/node.c
++++ b/node.c
+@@ -306,8 +306,24 @@ r_dupnode(NODE *n)
+       }
+ #endif
+-      getnode(r);
+-      *r = *n;
++#ifdef HAVE_MPFR
++      if ((n->flags & MPZN) != 0) {
++              r = mpg_integer();
++              mpz_set(r->mpg_i, n->mpg_i);
++              r->flags = n->flags;
++      } else if ((n->flags & MPFN) != 0) {
++              r = mpg_float();
++              int tval = mpfr_set(r->mpg_numbr, n->mpg_numbr, ROUND_MODE);
++              IEEE_FMT(r->mpg_numbr, tval);
++              r->flags = n->flags;
++      } else {
++#endif
++              getnode(r);
++              *r = *n;
++#ifdef HAVE_MPFR
++      }
++#endif
++
+       r->flags |= MALLOC;
+       r->valref = 1;
+       /*
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 40e25b2..93a6ee5 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -655,6 +655,9 @@ EXTRA_DIST = \
+       mpfrbigint.ok \
+       mpfrexprange.awk \
+       mpfrexprange.ok \
++      mpfrfield.awk \
++      mpfrfield.in \
++      mpfrfield.ok \
+       mpfrieee.awk \
+       mpfrieee.ok \
+       mpfrmemok1.awk \
+@@ -1302,8 +1305,8 @@ INET_TESTS = inetdayu inetdayt inetechu inetecht
+ MACHINE_TESTS = double1 double2 fmtspcl intformat
+-MPFR_TESTS = mpfrbigint mpfrexprange mpfrieee mpfrmemok1 mpfrnegzero \
+-      mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
++MPFR_TESTS = mpfrbigint mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
++      mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
+       mpfrstrtonum mpgforcenum mpfruplus
+ LOCALE_CHARSET_TESTS = \
+@@ -2148,6 +2151,11 @@ mpfrmemok1:
+       @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++mpfrfield:
++      @echo $@
++      @$(AWK) -M -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > _$@ 2>&1
++      @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++
+ jarebug::
+       @echo $@
+       @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
+diff --git a/test/Makefile.in b/test/Makefile.in
+index 74405f8..2358988 100644
+--- a/test/Makefile.in
++++ b/test/Makefile.in
+@@ -913,6 +913,9 @@ EXTRA_DIST = \
+       mpfrbigint.ok \
+       mpfrexprange.awk \
+       mpfrexprange.ok \
++      mpfrfield.awk \
++      mpfrfield.in \
++      mpfrfield.ok \
+       mpfrieee.awk \
+       mpfrieee.ok \
+       mpfrmemok1.awk \
+@@ -1555,8 +1558,8 @@ ARRAYDEBUG_TESTS = arrdbg
+ EXTRA_TESTS = inftest regtest ignrcas3 
+ INET_TESTS = inetdayu inetdayt inetechu inetecht
+ MACHINE_TESTS = double1 double2 fmtspcl intformat
+-MPFR_TESTS = mpfrbigint mpfrexprange mpfrieee mpfrmemok1 mpfrnegzero \
+-      mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
++MPFR_TESTS = mpfrbigint mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
++      mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
+       mpfrstrtonum mpgforcenum mpfruplus
+ LOCALE_CHARSET_TESTS = \
+@@ -2588,6 +2591,11 @@ mpfrmemok1:
+       @$(AWK) -p- -M -f "$(srcdir)"/$@.awk 2>&1 | sed 1d > _$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++mpfrfield:
++      @echo $@
++      @$(AWK) -M -f "$(srcdir)"/$@.awk "$(srcdir)"/$@.in > _$@ 2>&1
++      @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
++
+ jarebug::
+       @echo $@
+       @"$(srcdir)"/$@.sh "$(AWKPROG)" "$(srcdir)"/$@.awk "$(srcdir)"/$@.in "_$@"
+diff --git a/test/mpfrfield.awk b/test/mpfrfield.awk
+new file mode 100644
+index 0000000..35a97b7
+--- /dev/null
++++ b/test/mpfrfield.awk
+@@ -0,0 +1,14 @@
++#! /bin/gawk -Mf
++
++NR == 1 {
++      min = $1
++}
++
++{
++      if ($1 < min)
++              min = $1
++}
++
++END {
++      print "min", min
++}
+diff --git a/test/mpfrfield.in b/test/mpfrfield.in
+new file mode 100644
+index 0000000..05d3344
+--- /dev/null
++++ b/test/mpfrfield.in
+@@ -0,0 +1,10 @@
++7
++9
++1
++3
++9
++1
++9
++5
++0
++8
+diff --git a/test/mpfrfield.ok b/test/mpfrfield.ok
+new file mode 100644
+index 0000000..3736de4
+--- /dev/null
++++ b/test/mpfrfield.ok
+@@ -0,0 +1 @@
++min 0
+-- 
+2.14.4
+
diff --git a/gawk-4.2.1-003-fix-rebuilding-records-if-using-API-parser.patch b/gawk-4.2.1-003-fix-rebuilding-records-if-using-API-parser.patch
new file mode 100644 (file)
index 0000000..f5740e0
--- /dev/null
@@ -0,0 +1,129 @@
+From 50f617427403434dcca156fb081c1bdc7eb714b7 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <arnold@skeeve.com>
+Date: Tue, 17 Apr 2018 15:44:57 +0300
+Subject: [PATCH] Fix problem with rebuilding records if using API parser.
+
+---
+ field.c                 |  5 +++++
+ test/Makefile.am        | 10 +++++++++-
+ test/Makefile.in        | 10 +++++++++-
+ test/readdir_retest.awk |  7 +++++++
+ 4 files changed, 30 insertions(+), 2 deletions(-)
+ create mode 100644 test/readdir_retest.awk
+
+diff --git a/field.c b/field.c
+index 0d7e633..5296324 100644
+--- a/field.c
++++ b/field.c
+@@ -338,6 +338,11 @@ reset_record()
+ {
+       fields_arr[0] = force_string(fields_arr[0]);
+       purge_record();
++      if (api_parser_override) {
++              api_parser_override = false;
++              parse_field = normal_parse_field;
++              update_PROCINFO_str("FS", current_field_sep_str());
++      }
+ }
+ static void
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 93a6ee5..f554606 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -906,6 +906,7 @@ EXTRA_DIST = \
+       readbuf.ok \
+       readdir.awk \
+       readdir0.awk \
++      readdir_retest.awk \
+       readfile2.awk \
+       readfile2.ok \
+       rebrackloc.awk \
+@@ -1321,7 +1322,7 @@ SHLIB_TESTS = \
+       getfile \
+       inplace1 inplace2 inplace3 \
+       ordchr ordchr2 \
+-      readdir readdir_test readfile readfile2 revout \
++      readdir readdir_test readdir_retest readfile readfile2 revout \
+       revtwoway rwarray \
+       testext time
+@@ -2279,6 +2280,12 @@ readdir_test:
+       @$(AWK) -lreaddir_test '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > _$@
+       @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
++readdir_retest:
++      @echo $@
++      @$(AWK) -lreaddir -F/ -f $@.awk "$(top_srcdir)" > $@.ok
++      @$(AWK) -lreaddir_test -F/ -f $@.awk "$(top_srcdir)" > _$@
++      @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
++
+ fts:
+       @case `uname` in \
+       IRIX) \
+@@ -2500,6 +2507,7 @@ Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
+ clean-local:
+       rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 \
+       seq *~ readfile.ok fork.tmp.* testext.awk fts.ok readdir.ok \
++      readdir_test.ok readdir_retest.ok \
+       mmap8k.ok profile1.ok
+ # An attempt to print something that can be grepped for in build logs
+diff --git a/test/Makefile.in b/test/Makefile.in
+index 2358988..4133b58 100644
+--- a/test/Makefile.in
++++ b/test/Makefile.in
+@@ -1164,6 +1164,7 @@ EXTRA_DIST = \
+       readbuf.ok \
+       readdir.awk \
+       readdir0.awk \
++      readdir_retest.awk \
+       readfile2.awk \
+       readfile2.ok \
+       rebrackloc.awk \
+@@ -1574,7 +1575,7 @@ SHLIB_TESTS = \
+       getfile \
+       inplace1 inplace2 inplace3 \
+       ordchr ordchr2 \
+-      readdir readdir_test readfile readfile2 revout \
++      readdir readdir_test readdir_retest readfile readfile2 revout \
+       revtwoway rwarray \
+       testext time
+@@ -2719,6 +2720,12 @@ readdir_test:
+       @$(AWK) -lreaddir_test '{printf "[%s] [%s] [%s] [%s]\n", $$1, $$2, $$3, $$4}' "$(top_srcdir)" > _$@
+       @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
++readdir_retest:
++      @echo $@
++      @$(AWK) -lreaddir -F/ -f $@.awk "$(top_srcdir)" > $@.ok
++      @$(AWK) -lreaddir_test -F/ -f $@.awk "$(top_srcdir)" > _$@
++      @-$(CMP) $@.ok _$@ && rm -f $@.ok _$@
++
+ fts:
+       @case `uname` in \
+       IRIX) \
+@@ -4654,6 +4661,7 @@ Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
+ clean-local:
+       rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 \
+       seq *~ readfile.ok fork.tmp.* testext.awk fts.ok readdir.ok \
++      readdir_test.ok readdir_retest.ok \
+       mmap8k.ok profile1.ok
+ # An attempt to print something that can be grepped for in build logs
+diff --git a/test/readdir_retest.awk b/test/readdir_retest.awk
+new file mode 100644
+index 0000000..079a993
+--- /dev/null
++++ b/test/readdir_retest.awk
+@@ -0,0 +1,7 @@
++# Test field values after reparsing
++FNR == 1 { record1 = $0 }
++{
++      printf "[%s] [%s] [%s] [%s]\n", $1, $2, $3, $4
++      $0 = record1
++      printf "[%s] [%s] [%s] [%s]\n", $1, $2, $3, $4
++}
+-- 
+2.14.4
+
diff --git a/gawk-4.2.1-004-fix-a-corner-case-with-EPIPE-to-stdout-stderr.patch b/gawk-4.2.1-004-fix-a-corner-case-with-EPIPE-to-stdout-stderr.patch
new file mode 100644 (file)
index 0000000..0671fd4
--- /dev/null
@@ -0,0 +1,116 @@
+From 06fe8e801efc0e6a098d93cf104157fb4ef705e8 Mon Sep 17 00:00:00 2001
+From: "Arnold D. Robbins" <arnold@skeeve.com>
+Date: Sun, 17 Jun 2018 21:52:28 +0300
+Subject: [PATCH] Fix a corner case with EPIPE to stdout/stderr.
+
+---
+ awk.h       | 2 +-
+ debug.c     | 4 ++--
+ interpret.h | 6 +++++-
+ io.c        | 9 ++++++++-
+ 4 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/awk.h b/awk.h
+index 36e71f2..cdf683d 100644
+--- a/awk.h
++++ b/awk.h
+@@ -1581,7 +1581,7 @@ extern struct redirect *redirect_string(const char *redir_exp_str,
+               int *errflg, int extfd, bool failure_fatal);
+ extern NODE *do_close(int nargs);
+ extern int flush_io(void);
+-extern int close_io(bool *stdio_problem);
++extern int close_io(bool *stdio_problem, bool *got_EPIPE);
+ typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type;
+ extern int close_rp(struct redirect *rp, two_way_close_type how);
+ extern int devopen_simple(const char *name, const char *mode, bool try_real_open);
+diff --git a/debug.c b/debug.c
+index 3e76ae6..a587d8f 100644
+--- a/debug.c
++++ b/debug.c
+@@ -5398,11 +5398,11 @@ save_options(const char *file)
+ static void
+ close_all()
+ {
+-      bool stdio_problem;
++      bool stdio_problem, got_EPIPE;
+       struct command_source *cs;
+       (void) nextfile(& curfile, true);       /* close input data file */
+-      (void) close_io(& stdio_problem);
++      (void) close_io(& stdio_problem, & got_EPIPE);
+       if (cur_srcfile->fd != INVALID_HANDLE) {
+               close(cur_srcfile->fd);
+               cur_srcfile->fd = INVALID_HANDLE;
+diff --git a/interpret.h b/interpret.h
+index 20fcb7a..8408a53 100644
+--- a/interpret.h
++++ b/interpret.h
+@@ -110,6 +110,7 @@ top:
+               case Op_atexit:
+               {
+                       bool stdio_problem = false;
++                      bool got_EPIPE = false;
+                       /* avoid false source indications */
+                       source = NULL;
+@@ -125,7 +126,7 @@ top:
+                        * and pipes, in that it doesn't affect their exit status.
+                        * So we no longer do either.
+                        */
+-                      (void) close_io(& stdio_problem);
++                      (void) close_io(& stdio_problem, & got_EPIPE);
+                       /*
+                        * However, we do want to exit non-zero if there was a problem
+                        * with stdout/stderr, so we reinstate a slightly different
+@@ -135,6 +136,9 @@ top:
+                               exit_val = 1;
+                       close_extensions();
++
++                      if (got_EPIPE)
++                              die_via_sigpipe();
+               }
+                       break;
+diff --git a/io.c b/io.c
+index 1a1d8cc..faccb4b 100644
+--- a/io.c
++++ b/io.c
+@@ -1474,12 +1474,13 @@ flush_io()
+ /* close_io --- close all open files, called when exiting */
+ int
+-close_io(bool *stdio_problem)
++close_io(bool *stdio_problem, bool *got_EPIPE)
+ {
+       struct redirect *rp;
+       struct redirect *next;
+       int status = 0;
++      *stdio_problem = *got_EPIPE = false;
+       errno = 0;
+       for (rp = red_head; rp != NULL; rp = next) {
+               next = rp->next;
+@@ -1505,6 +1506,9 @@ close_io(bool *stdio_problem)
+ #endif
+               if (errno != EPIPE)
+                       warning(_("error writing standard output (%s)"), strerror(errno));
++              else
++                      *got_EPIPE = true;
++
+               status++;
+               *stdio_problem = true;
+       }
+@@ -1515,6 +1519,9 @@ close_io(bool *stdio_problem)
+ #endif
+               if (errno != EPIPE)
+                       warning(_("error writing standard error (%s)"), strerror(errno));
++              else
++                      *got_EPIPE = true;
++
+               status++;
+               *stdio_problem = true;
+       }
+-- 
+2.14.4
+
index 1571b92..fe8d56e 100644 (file)
--- a/gawk.spec
+++ b/gawk.spec
@@ -14,13 +14,18 @@ Summary(tr.UTF-8):  GNU araçları metin düzenleyici
 Summary(uk.UTF-8):     GNU версія утиліти обробки текстів awk
 Name:          gawk
 Version:       4.2.1
-Release:       1
+Release:       2
 License:       GPL v3+
 Group:         Applications/Text
 Source0:       http://ftp.gnu.org/gnu/gawk/%{name}-%{version}.tar.lz
 # Source0-md5: 4b1c1b18f40b5a4bc50e929480b06f89
 Source1:       http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5: 80753d75be0f469f70e8c90e75121a9c
+Patch100:      gawk-4.2.1-000-add-support-for-a-and-A-in-printf.patch
+Patch101:      gawk-4.2.1-001-remove-the-tail-recursion-optimization.patch
+Patch102:      gawk-4.2.1-002-copy-MPZ-MPFR-bits-also-in-r_dupnode.patch
+Patch103:      gawk-4.2.1-003-fix-rebuilding-records-if-using-API-parser.patch
+Patch104:      gawk-4.2.1-004-fix-a-corner-case-with-EPIPE-to-stdout-stderr.patch
 Patch0:                %{name}-info.patch
 Patch1:                %{name}-shutup.patch
 Patch2:                no-pty-test.patch
@@ -120,6 +125,12 @@ Ten pakiet zawiera pliki nagłówkowe dla gawka.
 
 %prep
 %setup -q
+%patch100 -p1
+%patch101 -p1
+%patch102 -p1
+%patch103 -p1
+%patch104 -p1
+
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
This page took 0.334569 seconds and 4 git commands to generate.