summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--TODO2
-rw-r--r--awkgram.c6
-rw-r--r--awkgram.y6
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.14
-rw-r--r--doc/gawk.info674
-rw-r--r--doc/gawk.texi2
-rw-r--r--doc/gawktexi.in2
9 files changed, 369 insertions, 339 deletions
diff --git a/ChangeLog b/ChangeLog
index 9399620c..a4202381 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awkgram.y (snode): Make it a fatal error to use a regexp constant
+ as the second argument of index(). Thanks to Christopher Durant
+ <christopher.durant@marquesa.net> and Brian Kernighan for the report
+ and the advice.
+
2013-04-28 Eli Zaretskii <eliz@gnu.org>
* io.c (redirect): Remove the HACK that called close_one when
diff --git a/TODO b/TODO
index da7c527f..bcc6cf69 100644
--- a/TODO
+++ b/TODO
@@ -39,8 +39,6 @@ Minor New Features
the options. And add an optional array argument to wait and
waitpid in which to return exit status information.
- Make index("foo", /foo/) fatal ala BWK awk.
-
Add a readfile() function in awk from mail.
Make writes to ENVIRON / deletions affect the real environment
diff --git a/awkgram.c b/awkgram.c
index f6cc6de0..10fd4215 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6533,6 +6533,12 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip->opcode = Op_push_array;
}
}
+ else if (r->builtin == do_index) {
+ arg = subn->nexti->lasti->nexti; /* 2nd arg list */
+ ip = arg->lasti;
+ if (ip->opcode == Op_match_rec)
+ fatal(_("index: regexp constant as second argument is not allowed"));
+ }
#ifdef ARRAYDEBUG
else if (r->builtin == do_adump) {
ip = subn->nexti->lasti;
diff --git a/awkgram.y b/awkgram.y
index 0d86d4e1..68647229 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3985,6 +3985,12 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
ip->opcode = Op_push_array;
}
}
+ else if (r->builtin == do_index) {
+ arg = subn->nexti->lasti->nexti; /* 2nd arg list */
+ ip = arg->lasti;
+ if (ip->opcode == Op_match_rec)
+ fatal(_("index: regexp constant as second argument is not allowed"));
+ }
#ifdef ARRAYDEBUG
else if (r->builtin == do_adump) {
ip = subn->nexti->lasti;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index f27efbad..aabda0f8 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-09 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in, gawk.1: Document that a regexp constant as the second
+ argument to index() produces a fatal error.
+
2013-04-27 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Renamed from gawkman.texi.
diff --git a/doc/gawk.1 b/doc/gawk.1
index 34fa7923..7f31c254 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -13,7 +13,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 24 2013" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "May 09 2013" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -2790,6 +2790,8 @@ or 0 if
.I t
is not present.
(This implies that character indices start at one.)
+It is a fatal error to use a regexp constant for
+.IR t .
.TP
\fBlength(\fR[\fIs\fR]\fB)
Return the length of the string
diff --git a/doc/gawk.info b/doc/gawk.info
index 7e013b6e..7d4f0d51 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -11334,6 +11334,8 @@ pound sign (`#'):
If FIND is not found, `index()' returns zero. (Remember that
string indices in `awk' start at one.)
+ It is a fatal error to use a regexp constant for FIND.
+
`length([STRING])'
Return the number of characters in STRING. If STRING is a number,
the length of the digit string representing that number is
@@ -29855,7 +29857,7 @@ Index
* caret (^), in bracket expressions: Bracket Expressions. (line 17)
* case keyword: Switch Statement. (line 6)
* case sensitivity, array indices and: Array Intro. (line 92)
-* case sensitivity, converting case: String Functions. (line 522)
+* case sensitivity, converting case: String Functions. (line 524)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
* case sensitivity, regexps and <1>: User-modified. (line 82)
@@ -29929,7 +29931,7 @@ Index
* common extensions, fflush() function: I/O Functions. (line 25)
* common extensions, func keyword: Definition Syntax. (line 83)
* common extensions, length() applied to an array: String Functions.
- (line 196)
+ (line 198)
* common extensions, nextfile statement: Nextfile Statement. (line 6)
* common extensions, RS as a regexp: Records. (line 120)
* common extensions, single character fields: Single Character Fields.
@@ -29975,7 +29977,7 @@ Index
(line 6)
* continue statement: Continue Statement. (line 6)
* control statements: Statements. (line 6)
-* converting, case: String Functions. (line 522)
+* converting, case: String Functions. (line 524)
* converting, dates to timestamps: Time Functions. (line 75)
* converting, during subscripting: Numeric Array Subscripts.
(line 31)
@@ -30034,7 +30036,7 @@ Index
(line 20)
* dark corner, input files: Records. (line 103)
* dark corner, invoking awk: Command Line. (line 16)
-* dark corner, length() function: String Functions. (line 182)
+* dark corner, length() function: String Functions. (line 184)
* dark corner, multiline records: Multiple Line. (line 35)
* dark corner, NF variable, decrementing: Changing Fields. (line 107)
* dark corner, OFMT variable: OFMT. (line 27)
@@ -30044,7 +30046,7 @@ Index
(line 147)
* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
(line 43)
-* dark corner, split() function: String Functions. (line 361)
+* dark corner, split() function: String Functions. (line 363)
* dark corner, strings, storing: Records. (line 195)
* dark corner, value of ARGV[0]: Auto-set. (line 35)
* data, fixed-width: Constant Size. (line 9)
@@ -30176,7 +30178,7 @@ Index
* deleting elements in arrays: Delete. (line 6)
* deleting entire arrays: Delete. (line 39)
* Demaille, Akim: Acknowledgments. (line 60)
-* differences between gawk and awk: String Functions. (line 196)
+* differences between gawk and awk: String Functions. (line 198)
* differences in awk and gawk, ARGC/ARGV variables: ARGC and ARGV.
(line 88)
* differences in awk and gawk, ARGIND variable: Auto-set. (line 40)
@@ -30219,7 +30221,7 @@ Index
(line 34)
* differences in awk and gawk, LINT variable: User-modified. (line 98)
* differences in awk and gawk, match() function: String Functions.
- (line 259)
+ (line 261)
* differences in awk and gawk, next/nextfile statements: Nextfile Statement.
(line 6)
* differences in awk and gawk, print/printf statements: Format Modifiers.
@@ -30235,11 +30237,11 @@ Index
* differences in awk and gawk, single-character fields: Single Character Fields.
(line 6)
* differences in awk and gawk, split() function: String Functions.
- (line 349)
+ (line 351)
* differences in awk and gawk, strings: Scalar Constants. (line 20)
* differences in awk and gawk, strings, storing: Records. (line 191)
* differences in awk and gawk, strtonum() function (gawk): String Functions.
- (line 404)
+ (line 406)
* differences in awk and gawk, SYMTAB variable: Auto-set. (line 271)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
(line 162)
@@ -30381,7 +30383,7 @@ Index
* extensions, common, fflush() function: I/O Functions. (line 25)
* extensions, common, func keyword: Definition Syntax. (line 83)
* extensions, common, length() applied to an array: String Functions.
- (line 196)
+ (line 198)
* extensions, common, nextfile statement: Nextfile Statement. (line 6)
* extensions, common, RS as a regexp: Records. (line 120)
* extensions, common, single character fields: Single Character Fields.
@@ -30763,7 +30765,7 @@ Index
* gsub() function <1>: String Functions. (line 139)
* gsub() function: Using Constant Regexps.
(line 43)
-* gsub() function, arguments of: String Functions. (line 462)
+* gsub() function, arguments of: String Functions. (line 464)
* gsub() function, escape processing: Gory Details. (line 6)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 66)
@@ -30931,7 +30933,7 @@ Index
(line 11)
* left shift, bitwise: Bitwise Functions. (line 32)
* leftmost longest match: Multiple Line. (line 26)
-* length() function: String Functions. (line 166)
+* length() function: String Functions. (line 168)
* Lesser General Public License (LGPL): Glossary. (line 405)
* LGPL (Lesser General Public License): Glossary. (line 405)
* libmawk: Other Versions. (line 114)
@@ -31013,9 +31015,9 @@ Index
(line 6)
* marked strings, extracting: String Extraction. (line 6)
* Marx, Groucho: Increment Ops. (line 60)
-* match() function: String Functions. (line 206)
+* match() function: String Functions. (line 208)
* match() function, RSTART/RLENGTH variables: String Functions.
- (line 223)
+ (line 225)
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
@@ -31209,7 +31211,7 @@ Index
* parentheses () <1>: Profiling. (line 138)
* parentheses (): Regexp Operators. (line 79)
* password file: Passwd Functions. (line 16)
-* patsplit() function: String Functions. (line 293)
+* patsplit() function: String Functions. (line 295)
* patterns: Patterns and Actions.
(line 6)
* patterns, comparison expressions as: Expression Patterns. (line 14)
@@ -31265,7 +31267,7 @@ Index
* portability, gawk: New Ports. (line 6)
* portability, gettext library and: Explaining gettext. (line 10)
* portability, internationalization and: I18N Portability. (line 6)
-* portability, length() function: String Functions. (line 175)
+* portability, length() function: String Functions. (line 177)
* portability, new awk vs. old awk: Conversion. (line 55)
* portability, next statement in user-defined functions: Pass By Value/Reference.
(line 91)
@@ -31273,7 +31275,7 @@ Index
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
* portability, POSIXLY_CORRECT environment variable: Options. (line 353)
-* portability, substr() function: String Functions. (line 512)
+* portability, substr() function: String Functions. (line 514)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 36)
* portable object files, converting to message object files: I18N Example.
@@ -31310,7 +31312,7 @@ Index
* POSIX awk, FS variable and: User-modified. (line 66)
* POSIX awk, function keyword in: Definition Syntax. (line 83)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 54)
-* POSIX awk, functions and, length(): String Functions. (line 175)
+* POSIX awk, functions and, length(): String Functions. (line 177)
* POSIX awk, GNU long options and: Options. (line 15)
* POSIX awk, interval expressions in: Regexp Operators. (line 135)
* POSIX awk, next/nextfile statements and: Next Statement. (line 45)
@@ -31518,7 +31520,7 @@ Index
* right shift, bitwise: Bitwise Functions. (line 32)
* Ritchie, Dennis: Basic Data Typing. (line 55)
* RLENGTH variable: Auto-set. (line 250)
-* RLENGTH variable, match() function and: String Functions. (line 223)
+* RLENGTH variable, match() function and: String Functions. (line 225)
* Robbins, Arnold <1>: Future Extensions. (line 6)
* Robbins, Arnold <2>: Bugs. (line 32)
* Robbins, Arnold <3>: Contributors. (line 122)
@@ -31545,7 +31547,7 @@ Index
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift() function (gawk): Bitwise Functions. (line 52)
* RSTART variable: Auto-set. (line 256)
-* RSTART variable, match() function and: String Functions. (line 223)
+* RSTART variable, match() function and: String Functions. (line 225)
* RT variable <1>: Auto-set. (line 263)
* RT variable <2>: Getline/Variable/File.
(line 10)
@@ -31701,10 +31703,10 @@ Index
* sparse arrays: Array Intro. (line 71)
* Spencer, Henry: Glossary. (line 12)
* split utility: Split Program. (line 6)
-* split() function: String Functions. (line 315)
+* split() function: String Functions. (line 317)
* split() function, array elements, deleting: Delete. (line 61)
* split.awk program: Split Program. (line 30)
-* sprintf() function <1>: String Functions. (line 380)
+* sprintf() function <1>: String Functions. (line 382)
* sprintf() function: OFMT. (line 15)
* sprintf() function, OFMT variable and: User-modified. (line 124)
* sprintf() function, print/printf statements and: Round Function.
@@ -31748,14 +31750,14 @@ Index
* strings, null: Regexp Field Splitting.
(line 43)
* strings, numeric: Variable Typing. (line 6)
-* strings, splitting: String Functions. (line 335)
-* strtonum() function (gawk): String Functions. (line 387)
+* strings, splitting: String Functions. (line 337)
+* strtonum() function (gawk): String Functions. (line 389)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 36)
-* sub() function <1>: String Functions. (line 408)
+* sub() function <1>: String Functions. (line 410)
* sub() function: Using Constant Regexps.
(line 43)
-* sub() function, arguments of: String Functions. (line 462)
+* sub() function, arguments of: String Functions. (line 464)
* sub() function, escape processing: Gory Details. (line 6)
* subscript separators: User-modified. (line 156)
* subscripts in arrays, multidimensional: Multi-dimensional. (line 10)
@@ -31768,7 +31770,7 @@ Index
* SUBSEP variable: User-modified. (line 156)
* SUBSEP variable, multidimensional arrays: Multi-dimensional.
(line 16)
-* substr() function: String Functions. (line 481)
+* substr() function: String Functions. (line 483)
* Sumner, Andrew: Other Versions. (line 64)
* switch statement: Switch Statement. (line 6)
* SYMTAB array: Auto-set. (line 271)
@@ -31823,8 +31825,8 @@ Index
* timestamps, converting dates to: Time Functions. (line 75)
* timestamps, formatted: Getlocaltime Function.
(line 6)
-* tolower() function: String Functions. (line 523)
-* toupper() function: String Functions. (line 529)
+* tolower() function: String Functions. (line 525)
+* toupper() function: String Functions. (line 531)
* tr utility: Translate Program. (line 6)
* trace debugger command: Miscellaneous Debugger Commands.
(line 108)
@@ -31847,9 +31849,9 @@ Index
* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in.
(line 16)
* troubleshooting, getline function: File Checking. (line 25)
-* troubleshooting, gsub()/sub() functions: String Functions. (line 472)
-* troubleshooting, match() function: String Functions. (line 288)
-* troubleshooting, patsplit() function: String Functions. (line 311)
+* troubleshooting, gsub()/sub() functions: String Functions. (line 474)
+* troubleshooting, match() function: String Functions. (line 290)
+* troubleshooting, patsplit() function: String Functions. (line 313)
* troubleshooting, print statement, omitting commas: Print Examples.
(line 31)
* troubleshooting, printing: Redirection. (line 118)
@@ -31858,7 +31860,7 @@ Index
* troubleshooting, regexp constants vs. string constants: Computed Regexps.
(line 38)
* troubleshooting, string concatenation: Concatenation. (line 27)
-* troubleshooting, substr() function: String Functions. (line 499)
+* troubleshooting, substr() function: String Functions. (line 501)
* troubleshooting, system() function: I/O Functions. (line 94)
* troubleshooting, typographical errors, global variables: Options.
(line 112)
@@ -32233,308 +32235,308 @@ Ref: Numeric Functions-Footnote-1471903
Ref: Numeric Functions-Footnote-2472260
Ref: Numeric Functions-Footnote-3472308
Node: String Functions472577
-Ref: String Functions-Footnote-1496074
-Ref: String Functions-Footnote-2496203
-Ref: String Functions-Footnote-3496451
-Node: Gory Details496538
-Ref: table-sub-escapes498217
-Ref: table-sub-posix-92499571
-Ref: table-sub-proposed500922
-Ref: table-posix-sub502276
-Ref: table-gensub-escapes503821
-Ref: Gory Details-Footnote-1504997
-Ref: Gory Details-Footnote-2505048
-Node: I/O Functions505199
-Ref: I/O Functions-Footnote-1512184
-Node: Time Functions512331
-Ref: Time Functions-Footnote-1523264
-Ref: Time Functions-Footnote-2523332
-Ref: Time Functions-Footnote-3523490
-Ref: Time Functions-Footnote-4523601
-Ref: Time Functions-Footnote-5523713
-Ref: Time Functions-Footnote-6523940
-Node: Bitwise Functions524206
-Ref: table-bitwise-ops524764
-Ref: Bitwise Functions-Footnote-1528985
-Node: Type Functions529169
-Node: I18N Functions529639
-Node: User-defined531266
-Node: Definition Syntax532070
-Ref: Definition Syntax-Footnote-1536980
-Node: Function Example537049
-Node: Function Caveats539643
-Node: Calling A Function540064
-Node: Variable Scope541179
-Node: Pass By Value/Reference544142
-Node: Return Statement547650
-Node: Dynamic Typing550631
-Node: Indirect Calls551562
-Node: Library Functions561247
-Ref: Library Functions-Footnote-1564760
-Ref: Library Functions-Footnote-2564903
-Node: Library Names565074
-Ref: Library Names-Footnote-1568545
-Ref: Library Names-Footnote-2568765
-Node: General Functions568851
-Node: Strtonum Function569804
-Node: Assert Function572734
-Node: Round Function576060
-Node: Cliff Random Function577603
-Node: Ordinal Functions578619
-Ref: Ordinal Functions-Footnote-1581689
-Ref: Ordinal Functions-Footnote-2581941
-Node: Join Function582150
-Ref: Join Function-Footnote-1583921
-Node: Getlocaltime Function584121
-Node: Data File Management587836
-Node: Filetrans Function588468
-Node: Rewind Function592537
-Node: File Checking593924
-Node: Empty Files595018
-Node: Ignoring Assigns597248
-Node: Getopt Function598801
-Ref: Getopt Function-Footnote-1610105
-Node: Passwd Functions610308
-Ref: Passwd Functions-Footnote-1619283
-Node: Group Functions619371
-Node: Walking Arrays627455
-Node: Sample Programs629592
-Node: Running Examples630266
-Node: Clones630994
-Node: Cut Program632218
-Node: Egrep Program642063
-Ref: Egrep Program-Footnote-1649836
-Node: Id Program649946
-Node: Split Program653562
-Ref: Split Program-Footnote-1657081
-Node: Tee Program657209
-Node: Uniq Program660012
-Node: Wc Program667441
-Ref: Wc Program-Footnote-1671707
-Ref: Wc Program-Footnote-2671907
-Node: Miscellaneous Programs671999
-Node: Dupword Program673187
-Node: Alarm Program675218
-Node: Translate Program679967
-Ref: Translate Program-Footnote-1684354
-Ref: Translate Program-Footnote-2684582
-Node: Labels Program684716
-Ref: Labels Program-Footnote-1688087
-Node: Word Sorting688171
-Node: History Sorting692055
-Node: Extract Program693894
-Ref: Extract Program-Footnote-1701395
-Node: Simple Sed701523
-Node: Igawk Program704585
-Ref: Igawk Program-Footnote-1719742
-Ref: Igawk Program-Footnote-2719943
-Node: Anagram Program720081
-Node: Signature Program723149
-Node: Advanced Features724249
-Node: Nondecimal Data726131
-Node: Array Sorting727714
-Node: Controlling Array Traversal728411
-Node: Array Sorting Functions736649
-Ref: Array Sorting Functions-Footnote-1740323
-Ref: Array Sorting Functions-Footnote-2740416
-Node: Two-way I/O740610
-Ref: Two-way I/O-Footnote-1746042
-Node: TCP/IP Networking746112
-Node: Profiling748956
-Node: Internationalization756411
-Node: I18N and L10N757836
-Node: Explaining gettext758522
-Ref: Explaining gettext-Footnote-1763588
-Ref: Explaining gettext-Footnote-2763772
-Node: Programmer i18n763937
-Node: Translator i18n768137
-Node: String Extraction768930
-Ref: String Extraction-Footnote-1769891
-Node: Printf Ordering769977
-Ref: Printf Ordering-Footnote-1772761
-Node: I18N Portability772825
-Ref: I18N Portability-Footnote-1775274
-Node: I18N Example775337
-Ref: I18N Example-Footnote-1777972
-Node: Gawk I18N778044
-Node: Debugger778665
-Node: Debugging779636
-Node: Debugging Concepts780069
-Node: Debugging Terms781925
-Node: Awk Debugging784522
-Node: Sample Debugging Session785414
-Node: Debugger Invocation785934
-Node: Finding The Bug787266
-Node: List of Debugger Commands793754
-Node: Breakpoint Control795088
-Node: Debugger Execution Control798752
-Node: Viewing And Changing Data802112
-Node: Execution Stack805468
-Node: Debugger Info806935
-Node: Miscellaneous Debugger Commands810917
-Node: Readline Support816093
-Node: Limitations816924
-Node: Arbitrary Precision Arithmetic819176
-Ref: Arbitrary Precision Arithmetic-Footnote-1820827
-Node: General Arithmetic820975
-Node: Floating Point Issues822695
-Node: String Conversion Precision823576
-Ref: String Conversion Precision-Footnote-1825282
-Node: Unexpected Results825391
-Node: POSIX Floating Point Problems827544
-Ref: POSIX Floating Point Problems-Footnote-1831369
-Node: Integer Programming831407
-Node: Floating-point Programming833146
-Ref: Floating-point Programming-Footnote-1839477
-Ref: Floating-point Programming-Footnote-2839747
-Node: Floating-point Representation840011
-Node: Floating-point Context841176
-Ref: table-ieee-formats842015
-Node: Rounding Mode843399
-Ref: table-rounding-modes843878
-Ref: Rounding Mode-Footnote-1846893
-Node: Gawk and MPFR847072
-Node: Arbitrary Precision Floats848327
-Ref: Arbitrary Precision Floats-Footnote-1850770
-Node: Setting Precision851086
-Ref: table-predefined-precision-strings851772
-Node: Setting Rounding Mode853917
-Ref: table-gawk-rounding-modes854321
-Node: Floating-point Constants855508
-Node: Changing Precision856937
-Ref: Changing Precision-Footnote-1858337
-Node: Exact Arithmetic858511
-Node: Arbitrary Precision Integers861649
-Ref: Arbitrary Precision Integers-Footnote-1864667
-Node: Dynamic Extensions864814
-Node: Extension Intro866272
-Node: Plugin License867537
-Node: Extension Mechanism Outline868222
-Ref: load-extension868639
-Ref: load-new-function870117
-Ref: call-new-function871112
-Node: Extension API Description873127
-Node: Extension API Functions Introduction874340
-Node: General Data Types879206
-Ref: General Data Types-Footnote-1884808
-Node: Requesting Values885107
-Ref: table-value-types-returned885838
-Node: Constructor Functions886792
-Node: Registration Functions889812
-Node: Extension Functions890497
-Node: Exit Callback Functions892722
-Node: Extension Version String893971
-Node: Input Parsers894621
-Node: Output Wrappers904378
-Node: Two-way processors908888
-Node: Printing Messages911096
-Ref: Printing Messages-Footnote-1912173
-Node: Updating `ERRNO'912325
-Node: Accessing Parameters913064
-Node: Symbol Table Access914294
-Node: Symbol table by name914806
-Node: Symbol table by cookie916553
-Ref: Symbol table by cookie-Footnote-1920683
-Node: Cached values920746
-Ref: Cached values-Footnote-1924195
-Node: Array Manipulation924286
-Ref: Array Manipulation-Footnote-1925384
-Node: Array Data Types925423
-Ref: Array Data Types-Footnote-1928126
-Node: Array Functions928218
-Node: Flattening Arrays931984
-Node: Creating Arrays938836
-Node: Extension API Variables943561
-Node: Extension Versioning944197
-Node: Extension API Informational Variables946098
-Node: Extension API Boilerplate947184
-Node: Finding Extensions950988
-Node: Extension Example951548
-Node: Internal File Description952279
-Node: Internal File Ops955967
-Ref: Internal File Ops-Footnote-1967451
-Node: Using Internal File Ops967591
-Ref: Using Internal File Ops-Footnote-1969944
-Node: Extension Samples970210
-Node: Extension Sample File Functions971734
-Node: Extension Sample Fnmatch980221
-Node: Extension Sample Fork981947
-Node: Extension Sample Inplace983165
-Node: Extension Sample Ord984943
-Node: Extension Sample Readdir985779
-Node: Extension Sample Revout987311
-Node: Extension Sample Rev2way987904
-Node: Extension Sample Read write array988594
-Node: Extension Sample Readfile990477
-Node: Extension Sample API Tests991295
-Node: Extension Sample Time991820
-Node: gawkextlib993184
-Node: Language History995615
-Node: V7/SVR3.1997137
-Node: SVR4999458
-Node: POSIX1000900
-Node: BTL1002286
-Node: POSIX/GNU1003020
-Node: Common Extensions1008555
-Node: Ranges and Locales1009710
-Ref: Ranges and Locales-Footnote-11014328
-Ref: Ranges and Locales-Footnote-21014355
-Ref: Ranges and Locales-Footnote-31014615
-Node: Contributors1014836
-Node: Installation1019640
-Node: Gawk Distribution1020534
-Node: Getting1021018
-Node: Extracting1021844
-Node: Distribution contents1023536
-Node: Unix Installation1028797
-Node: Quick Installation1029414
-Node: Additional Configuration Options1031376
-Node: Configuration Philosophy1032853
-Node: Non-Unix Installation1035195
-Node: PC Installation1035653
-Node: PC Binary Installation1036952
-Node: PC Compiling1038800
-Node: PC Testing1041744
-Node: PC Using1042920
-Node: Cygwin1047105
-Node: MSYS1048105
-Node: VMS Installation1048619
-Node: VMS Compilation1049222
-Ref: VMS Compilation-Footnote-11050229
-Node: VMS Installation Details1050287
-Node: VMS Running1051922
-Node: VMS Old Gawk1053529
-Node: Bugs1054003
-Node: Other Versions1057855
-Node: Notes1063456
-Node: Compatibility Mode1064256
-Node: Additions1065039
-Node: Accessing The Source1065966
-Node: Adding Code1067406
-Node: New Ports1073451
-Node: Derived Files1077586
-Ref: Derived Files-Footnote-11082907
-Ref: Derived Files-Footnote-21082941
-Ref: Derived Files-Footnote-31083541
-Node: Future Extensions1083639
-Node: Implementation Limitations1084220
-Node: Extension Design1085472
-Node: Old Extension Problems1086626
-Ref: Old Extension Problems-Footnote-11088134
-Node: Extension New Mechanism Goals1088191
-Ref: Extension New Mechanism Goals-Footnote-11091557
-Node: Extension Other Design Decisions1091743
-Node: Extension Future Growth1093849
-Node: Old Extension Mechanism1094685
-Node: Basic Concepts1096425
-Node: Basic High Level1097106
-Ref: figure-general-flow1097377
-Ref: figure-process-flow1097976
-Ref: Basic High Level-Footnote-11101205
-Node: Basic Data Typing1101390
-Node: Glossary1104745
-Node: Copying1130216
-Node: GNU Free Documentation License1167773
-Node: Index1192910
+Ref: String Functions-Footnote-1496135
+Ref: String Functions-Footnote-2496264
+Ref: String Functions-Footnote-3496512
+Node: Gory Details496599
+Ref: table-sub-escapes498278
+Ref: table-sub-posix-92499632
+Ref: table-sub-proposed500983
+Ref: table-posix-sub502337
+Ref: table-gensub-escapes503882
+Ref: Gory Details-Footnote-1505058
+Ref: Gory Details-Footnote-2505109
+Node: I/O Functions505260
+Ref: I/O Functions-Footnote-1512245
+Node: Time Functions512392
+Ref: Time Functions-Footnote-1523325
+Ref: Time Functions-Footnote-2523393
+Ref: Time Functions-Footnote-3523551
+Ref: Time Functions-Footnote-4523662
+Ref: Time Functions-Footnote-5523774
+Ref: Time Functions-Footnote-6524001
+Node: Bitwise Functions524267
+Ref: table-bitwise-ops524825
+Ref: Bitwise Functions-Footnote-1529046
+Node: Type Functions529230
+Node: I18N Functions529700
+Node: User-defined531327
+Node: Definition Syntax532131
+Ref: Definition Syntax-Footnote-1537041
+Node: Function Example537110
+Node: Function Caveats539704
+Node: Calling A Function540125
+Node: Variable Scope541240
+Node: Pass By Value/Reference544203
+Node: Return Statement547711
+Node: Dynamic Typing550692
+Node: Indirect Calls551623
+Node: Library Functions561308
+Ref: Library Functions-Footnote-1564821
+Ref: Library Functions-Footnote-2564964
+Node: Library Names565135
+Ref: Library Names-Footnote-1568606
+Ref: Library Names-Footnote-2568826
+Node: General Functions568912
+Node: Strtonum Function569865
+Node: Assert Function572795
+Node: Round Function576121
+Node: Cliff Random Function577664
+Node: Ordinal Functions578680
+Ref: Ordinal Functions-Footnote-1581750
+Ref: Ordinal Functions-Footnote-2582002
+Node: Join Function582211
+Ref: Join Function-Footnote-1583982
+Node: Getlocaltime Function584182
+Node: Data File Management587897
+Node: Filetrans Function588529
+Node: Rewind Function592598
+Node: File Checking593985
+Node: Empty Files595079
+Node: Ignoring Assigns597309
+Node: Getopt Function598862
+Ref: Getopt Function-Footnote-1610166
+Node: Passwd Functions610369
+Ref: Passwd Functions-Footnote-1619344
+Node: Group Functions619432
+Node: Walking Arrays627516
+Node: Sample Programs629653
+Node: Running Examples630327
+Node: Clones631055
+Node: Cut Program632279
+Node: Egrep Program642124
+Ref: Egrep Program-Footnote-1649897
+Node: Id Program650007
+Node: Split Program653623
+Ref: Split Program-Footnote-1657142
+Node: Tee Program657270
+Node: Uniq Program660073
+Node: Wc Program667502
+Ref: Wc Program-Footnote-1671768
+Ref: Wc Program-Footnote-2671968
+Node: Miscellaneous Programs672060
+Node: Dupword Program673248
+Node: Alarm Program675279
+Node: Translate Program680028
+Ref: Translate Program-Footnote-1684415
+Ref: Translate Program-Footnote-2684643
+Node: Labels Program684777
+Ref: Labels Program-Footnote-1688148
+Node: Word Sorting688232
+Node: History Sorting692116
+Node: Extract Program693955
+Ref: Extract Program-Footnote-1701456
+Node: Simple Sed701584
+Node: Igawk Program704646
+Ref: Igawk Program-Footnote-1719803
+Ref: Igawk Program-Footnote-2720004
+Node: Anagram Program720142
+Node: Signature Program723210
+Node: Advanced Features724310
+Node: Nondecimal Data726192
+Node: Array Sorting727775
+Node: Controlling Array Traversal728472
+Node: Array Sorting Functions736710
+Ref: Array Sorting Functions-Footnote-1740384
+Ref: Array Sorting Functions-Footnote-2740477
+Node: Two-way I/O740671
+Ref: Two-way I/O-Footnote-1746103
+Node: TCP/IP Networking746173
+Node: Profiling749017
+Node: Internationalization756472
+Node: I18N and L10N757897
+Node: Explaining gettext758583
+Ref: Explaining gettext-Footnote-1763649
+Ref: Explaining gettext-Footnote-2763833
+Node: Programmer i18n763998
+Node: Translator i18n768198
+Node: String Extraction768991
+Ref: String Extraction-Footnote-1769952
+Node: Printf Ordering770038
+Ref: Printf Ordering-Footnote-1772822
+Node: I18N Portability772886
+Ref: I18N Portability-Footnote-1775335
+Node: I18N Example775398
+Ref: I18N Example-Footnote-1778033
+Node: Gawk I18N778105
+Node: Debugger778726
+Node: Debugging779697
+Node: Debugging Concepts780130
+Node: Debugging Terms781986
+Node: Awk Debugging784583
+Node: Sample Debugging Session785475
+Node: Debugger Invocation785995
+Node: Finding The Bug787327
+Node: List of Debugger Commands793815
+Node: Breakpoint Control795149
+Node: Debugger Execution Control798813
+Node: Viewing And Changing Data802173
+Node: Execution Stack805529
+Node: Debugger Info806996
+Node: Miscellaneous Debugger Commands810978
+Node: Readline Support816154
+Node: Limitations816985
+Node: Arbitrary Precision Arithmetic819237
+Ref: Arbitrary Precision Arithmetic-Footnote-1820888
+Node: General Arithmetic821036
+Node: Floating Point Issues822756
+Node: String Conversion Precision823637
+Ref: String Conversion Precision-Footnote-1825343
+Node: Unexpected Results825452
+Node: POSIX Floating Point Problems827605
+Ref: POSIX Floating Point Problems-Footnote-1831430
+Node: Integer Programming831468
+Node: Floating-point Programming833207
+Ref: Floating-point Programming-Footnote-1839538
+Ref: Floating-point Programming-Footnote-2839808
+Node: Floating-point Representation840072
+Node: Floating-point Context841237
+Ref: table-ieee-formats842076
+Node: Rounding Mode843460
+Ref: table-rounding-modes843939
+Ref: Rounding Mode-Footnote-1846954
+Node: Gawk and MPFR847133
+Node: Arbitrary Precision Floats848388
+Ref: Arbitrary Precision Floats-Footnote-1850831
+Node: Setting Precision851147
+Ref: table-predefined-precision-strings851833
+Node: Setting Rounding Mode853978
+Ref: table-gawk-rounding-modes854382
+Node: Floating-point Constants855569
+Node: Changing Precision856998
+Ref: Changing Precision-Footnote-1858398
+Node: Exact Arithmetic858572
+Node: Arbitrary Precision Integers861710
+Ref: Arbitrary Precision Integers-Footnote-1864728
+Node: Dynamic Extensions864875
+Node: Extension Intro866333
+Node: Plugin License867598
+Node: Extension Mechanism Outline868283
+Ref: load-extension868700
+Ref: load-new-function870178
+Ref: call-new-function871173
+Node: Extension API Description873188
+Node: Extension API Functions Introduction874401
+Node: General Data Types879267
+Ref: General Data Types-Footnote-1884869
+Node: Requesting Values885168
+Ref: table-value-types-returned885899
+Node: Constructor Functions886853
+Node: Registration Functions889873
+Node: Extension Functions890558
+Node: Exit Callback Functions892783
+Node: Extension Version String894032
+Node: Input Parsers894682
+Node: Output Wrappers904439
+Node: Two-way processors908949
+Node: Printing Messages911157
+Ref: Printing Messages-Footnote-1912234
+Node: Updating `ERRNO'912386
+Node: Accessing Parameters913125
+Node: Symbol Table Access914355
+Node: Symbol table by name914867
+Node: Symbol table by cookie916614
+Ref: Symbol table by cookie-Footnote-1920744
+Node: Cached values920807
+Ref: Cached values-Footnote-1924256
+Node: Array Manipulation924347
+Ref: Array Manipulation-Footnote-1925445
+Node: Array Data Types925484
+Ref: Array Data Types-Footnote-1928187
+Node: Array Functions928279
+Node: Flattening Arrays932045
+Node: Creating Arrays938897
+Node: Extension API Variables943622
+Node: Extension Versioning944258
+Node: Extension API Informational Variables946159
+Node: Extension API Boilerplate947245
+Node: Finding Extensions951049
+Node: Extension Example951609
+Node: Internal File Description952340
+Node: Internal File Ops956028
+Ref: Internal File Ops-Footnote-1967512
+Node: Using Internal File Ops967652
+Ref: Using Internal File Ops-Footnote-1970005
+Node: Extension Samples970271
+Node: Extension Sample File Functions971795
+Node: Extension Sample Fnmatch980282
+Node: Extension Sample Fork982008
+Node: Extension Sample Inplace983226
+Node: Extension Sample Ord985004
+Node: Extension Sample Readdir985840
+Node: Extension Sample Revout987372
+Node: Extension Sample Rev2way987965
+Node: Extension Sample Read write array988655
+Node: Extension Sample Readfile990538
+Node: Extension Sample API Tests991356
+Node: Extension Sample Time991881
+Node: gawkextlib993245
+Node: Language History995676
+Node: V7/SVR3.1997198
+Node: SVR4999519
+Node: POSIX1000961
+Node: BTL1002347
+Node: POSIX/GNU1003081
+Node: Common Extensions1008616
+Node: Ranges and Locales1009771
+Ref: Ranges and Locales-Footnote-11014389
+Ref: Ranges and Locales-Footnote-21014416
+Ref: Ranges and Locales-Footnote-31014676
+Node: Contributors1014897
+Node: Installation1019701
+Node: Gawk Distribution1020595
+Node: Getting1021079
+Node: Extracting1021905
+Node: Distribution contents1023597
+Node: Unix Installation1028858
+Node: Quick Installation1029475
+Node: Additional Configuration Options1031437
+Node: Configuration Philosophy1032914
+Node: Non-Unix Installation1035256
+Node: PC Installation1035714
+Node: PC Binary Installation1037013
+Node: PC Compiling1038861
+Node: PC Testing1041805
+Node: PC Using1042981
+Node: Cygwin1047166
+Node: MSYS1048166
+Node: VMS Installation1048680
+Node: VMS Compilation1049283
+Ref: VMS Compilation-Footnote-11050290
+Node: VMS Installation Details1050348
+Node: VMS Running1051983
+Node: VMS Old Gawk1053590
+Node: Bugs1054064
+Node: Other Versions1057916
+Node: Notes1063517
+Node: Compatibility Mode1064317
+Node: Additions1065100
+Node: Accessing The Source1066027
+Node: Adding Code1067467
+Node: New Ports1073512
+Node: Derived Files1077647
+Ref: Derived Files-Footnote-11082968
+Ref: Derived Files-Footnote-21083002
+Ref: Derived Files-Footnote-31083602
+Node: Future Extensions1083700
+Node: Implementation Limitations1084281
+Node: Extension Design1085533
+Node: Old Extension Problems1086687
+Ref: Old Extension Problems-Footnote-11088195
+Node: Extension New Mechanism Goals1088252
+Ref: Extension New Mechanism Goals-Footnote-11091618
+Node: Extension Other Design Decisions1091804
+Node: Extension Future Growth1093910
+Node: Old Extension Mechanism1094746
+Node: Basic Concepts1096486
+Node: Basic High Level1097167
+Ref: figure-general-flow1097438
+Ref: figure-process-flow1098037
+Ref: Basic High Level-Footnote-11101266
+Node: Basic Data Typing1101451
+Node: Glossary1104806
+Node: Copying1130277
+Node: GNU Free Documentation License1167834
+Node: Index1192971

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index fcd07a07..d323ff6d 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -15767,6 +15767,8 @@ $ @kbd{awk 'BEGIN @{ print index("peanut", "an") @}'}
If @var{find} is not found, @code{index()} returns zero.
(Remember that string indices in @command{awk} start at one.)
+It is a fatal error to use a regexp constant for @var{find}.
+
@item length(@r{[}@var{string}@r{]})
@cindex @code{length()} function
Return the number of characters in @var{string}. If
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 799c172f..b5e682bb 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -15106,6 +15106,8 @@ $ @kbd{awk 'BEGIN @{ print index("peanut", "an") @}'}
If @var{find} is not found, @code{index()} returns zero.
(Remember that string indices in @command{awk} start at one.)
+It is a fatal error to use a regexp constant for @var{find}.
+
@item length(@r{[}@var{string}@r{]})
@cindex @code{length()} function
Return the number of characters in @var{string}. If