diff options
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | doc/ChangeLog | 6 | ||||
-rw-r--r-- | doc/gawk.info | 1017 | ||||
-rw-r--r-- | doc/gawk.texi | 29 | ||||
-rw-r--r-- | doc/gawktexi.in | 29 | ||||
-rw-r--r-- | regcomp.c | 18 | ||||
-rw-r--r-- | regex.h | 2 | ||||
-rw-r--r-- | regex_internal.c | 2 | ||||
-rw-r--r-- | regex_internal.h | 5 | ||||
-rw-r--r-- | regexec.c | 16 |
10 files changed, 613 insertions, 527 deletions
@@ -1,3 +1,19 @@ +2016-01-18 Paul Eggert <eggert@cs.ucla.edu> + + Diagnose ERE '()|\1' + Problem reported by Hanno Boeck in: http://bugs.gnu.org/21513 + + * lib/regcomp.c (parse_reg_exp): While parsing alternatives, keep + track of the set of previously-completed subexpressions available + before the first alternative, and restore this set just before + parsing each subsequent alternative. This lets us diagnose the + invalid back-reference in the ERE '()|\1'. + + Unrelated: General minor cleanups (spelling, code) from Gnulib: + + * regex.h, regex_internal.c, regex_internal.h, regexec.c: Minor + cleanups. + 2016-01-14 Arnold D. Robbins <arnold@skeeve.com> * eval.c (r_get_lhs): If original array was Node_var_new, diff --git a/doc/ChangeLog b/doc/ChangeLog index 71bc1ec9..06248165 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2016-01-18 Arnold D. Robbins <arnold@skeeve.com> + + * gawktexi.in (Bracket Expressions): Document that '[', '.' and + '*' are literal inside bracket expressions. + (Two-way I/O): Add stuff about stdbuf and deadlocks. + 2016-01-15 Arnold D. Robbins <arnold@skeeve.com> * gawktexi.in (Array Sorting Functions): Clean up the code some, diff --git a/doc/gawk.info b/doc/gawk.info index 2ca2dfa7..c0c44864 100644 --- a/doc/gawk.info +++ b/doc/gawk.info @@ -3810,6 +3810,10 @@ Equivalence classes classes; they do not recognize collating symbols or equivalence classes. + Inside a bracket expression, an opening bracket ('[') that does not +start a character class, collating element or equivalence class is taken +literally. This is also true of '.' and '*'. + File: gawk.info, Node: Leftmost Longest, Next: Computed Regexps, Prev: Bracket Expressions, Up: Regexp @@ -19866,10 +19870,27 @@ Auto-set::), like so: print ... |& command # start two-way pipe ... -Using ptys usually avoids the buffer deadlock issues described earlier, -at some loss in performance. If your system does not have ptys, or if -all the system's ptys are in use, 'gawk' automatically falls back to -using regular pipes. +If your system does not have ptys, or if all the system's ptys are in +use, 'gawk' automatically falls back to using regular pipes. + + Using ptys usually avoids the buffer deadlock issues described +earlier, at some loss in performance. This is because the tty driver +buffers and sends data line-by-line. On systems with the 'stdbuf' (part +of the GNU Coreutils package +(http://www.gnu.org/software/coreutils/coreutils.html)), you can use +that program instead of ptys. + + Note also that ptys are not fully transparent. Certain binary +control codes, such 'Ctrl-d' for end-of-file, are interpreted by the tty +driver and not passed through. + + CAUTION: Finally, coprocesses open up the possibility of "deadlock" + between 'gawk' and the program running in the coprocess. This can + occur if you send "too much" data to the coprocess before reading + any back; each process is blocked writing data with noone available + to read what they've already written. There is no workaround for + deadlock; careful programming and knowledge of the behavior of the + coprocess are required. ---------- Footnotes ---------- @@ -35147,499 +35168,499 @@ Ref: Regexp Operators-Footnote-1171101 Ref: Regexp Operators-Footnote-2171248 Node: Bracket Expressions171346 Ref: table-char-classes173369 -Node: Leftmost Longest176315 -Node: Computed Regexps177618 -Node: GNU Regexp Operators181045 -Node: Case-sensitivity184724 -Ref: Case-sensitivity-Footnote-1187620 -Ref: Case-sensitivity-Footnote-2187855 -Node: Strong Regexp Constants187963 -Node: Regexp Summary190905 -Node: Reading Files192511 -Node: Records194674 -Node: awk split records195407 -Node: gawk split records200339 -Ref: gawk split records-Footnote-1204883 -Node: Fields204920 -Node: Nonconstant Fields207661 -Ref: Nonconstant Fields-Footnote-1209897 -Node: Changing Fields210101 -Node: Field Separators216031 -Node: Default Field Splitting218729 -Node: Regexp Field Splitting219847 -Node: Single Character Fields223200 -Node: Command Line Field Separator224260 -Node: Full Line Fields227478 -Ref: Full Line Fields-Footnote-1229000 -Ref: Full Line Fields-Footnote-2229046 -Node: Field Splitting Summary229147 -Node: Constant Size231221 -Node: Splitting By Content235800 -Ref: Splitting By Content-Footnote-1239771 -Node: Multiple Line239934 -Ref: Multiple Line-Footnote-1245817 -Node: Getline245996 -Node: Plain Getline248463 -Node: Getline/Variable251102 -Node: Getline/File252251 -Node: Getline/Variable/File253637 -Ref: Getline/Variable/File-Footnote-1255241 -Node: Getline/Pipe255329 -Node: Getline/Variable/Pipe258034 -Node: Getline/Coprocess259167 -Node: Getline/Variable/Coprocess260432 -Node: Getline Notes261172 -Node: Getline Summary263967 -Ref: table-getline-variants264389 -Node: Read Timeout265137 -Ref: Read Timeout-Footnote-1269044 -Node: Retrying Input269102 -Node: Command-line directories270301 -Node: Input Summary271208 -Node: Input Exercises274380 -Node: Printing275108 -Node: Print276943 -Node: Print Examples278400 -Node: Output Separators281180 -Node: OFMT283197 -Node: Printf284553 -Node: Basic Printf285338 -Node: Control Letters286912 -Node: Format Modifiers290900 -Node: Printf Examples296915 -Node: Redirection299401 -Node: Special FD306244 -Ref: Special FD-Footnote-1309412 -Node: Special Files309486 -Node: Other Inherited Files310103 -Node: Special Network311104 -Node: Special Caveats311964 -Node: Close Files And Pipes312913 -Ref: Close Files And Pipes-Footnote-1320100 -Ref: Close Files And Pipes-Footnote-2320248 -Node: Nonfatal320399 -Node: Output Summary322724 -Node: Output Exercises323946 -Node: Expressions324625 -Node: Values325813 -Node: Constants326491 -Node: Scalar Constants327182 -Ref: Scalar Constants-Footnote-1328046 -Node: Nondecimal-numbers328296 -Node: Regexp Constants331310 -Node: Using Constant Regexps331836 -Node: Variables334999 -Node: Using Variables335656 -Node: Assignment Options337567 -Node: Conversion339441 -Node: Strings And Numbers339965 -Ref: Strings And Numbers-Footnote-1343029 -Node: Locale influences conversions343138 -Ref: table-locale-affects345896 -Node: All Operators346514 -Node: Arithmetic Ops347143 -Node: Concatenation349649 -Ref: Concatenation-Footnote-1352496 -Node: Assignment Ops352603 -Ref: table-assign-ops357595 -Node: Increment Ops358908 -Node: Truth Values and Conditions362368 -Node: Truth Values363442 -Node: Typing and Comparison364490 -Node: Variable Typing365310 -Node: Comparison Operators368934 -Ref: table-relational-ops369353 -Node: POSIX String Comparison372848 -Ref: POSIX String Comparison-Footnote-1373922 -Node: Boolean Ops374061 -Ref: Boolean Ops-Footnote-1378543 -Node: Conditional Exp378635 -Node: Function Calls380371 -Node: Precedence384251 -Node: Locales387910 -Node: Expressions Summary389542 -Node: Patterns and Actions392115 -Node: Pattern Overview393235 -Node: Regexp Patterns394912 -Node: Expression Patterns395454 -Node: Ranges399235 -Node: BEGIN/END402343 -Node: Using BEGIN/END403104 -Ref: Using BEGIN/END-Footnote-1405841 -Node: I/O And BEGIN/END405947 -Node: BEGINFILE/ENDFILE408263 -Node: Empty411170 -Node: Using Shell Variables411487 -Node: Action Overview413761 -Node: Statements416086 -Node: If Statement417934 -Node: While Statement419429 -Node: Do Statement421457 -Node: For Statement422605 -Node: Switch Statement425764 -Node: Break Statement428150 -Node: Continue Statement430242 -Node: Next Statement432069 -Node: Nextfile Statement434452 -Node: Exit Statement437104 -Node: Built-in Variables439509 -Node: User-modified440642 -Node: Auto-set448230 -Ref: Auto-set-Footnote-1462623 -Ref: Auto-set-Footnote-2462829 -Node: ARGC and ARGV462885 -Node: Pattern Action Summary467104 -Node: Arrays469534 -Node: Array Basics470863 -Node: Array Intro471707 -Ref: figure-array-elements473682 -Ref: Array Intro-Footnote-1476386 -Node: Reference to Elements476514 -Node: Assigning Elements478978 -Node: Array Example479469 -Node: Scanning an Array481228 -Node: Controlling Scanning484252 -Ref: Controlling Scanning-Footnote-1489651 -Node: Numeric Array Subscripts489967 -Node: Uninitialized Subscripts492151 -Node: Delete493770 -Ref: Delete-Footnote-1496522 -Node: Multidimensional496579 -Node: Multiscanning499674 -Node: Arrays of Arrays501265 -Node: Arrays Summary506033 -Node: Functions508126 -Node: Built-in509164 -Node: Calling Built-in510242 -Node: Numeric Functions512238 -Ref: Numeric Functions-Footnote-1517071 -Ref: Numeric Functions-Footnote-2517428 -Ref: Numeric Functions-Footnote-3517476 -Node: String Functions517748 -Ref: String Functions-Footnote-1541256 -Ref: String Functions-Footnote-2541385 -Ref: String Functions-Footnote-3541633 -Node: Gory Details541720 -Ref: table-sub-escapes543511 -Ref: table-sub-proposed545030 -Ref: table-posix-sub546393 -Ref: table-gensub-escapes547934 -Ref: Gory Details-Footnote-1548757 -Node: I/O Functions548908 -Ref: I/O Functions-Footnote-1556129 -Node: Time Functions556277 -Ref: Time Functions-Footnote-1566782 -Ref: Time Functions-Footnote-2566850 -Ref: Time Functions-Footnote-3567008 -Ref: Time Functions-Footnote-4567119 -Ref: Time Functions-Footnote-5567231 -Ref: Time Functions-Footnote-6567458 -Node: Bitwise Functions567724 -Ref: table-bitwise-ops568318 -Ref: Bitwise Functions-Footnote-1572656 -Node: Type Functions572829 -Node: I18N Functions575490 -Node: User-defined577141 -Node: Definition Syntax577946 -Ref: Definition Syntax-Footnote-1583633 -Node: Function Example583704 -Ref: Function Example-Footnote-1586626 -Node: Function Caveats586648 -Node: Calling A Function587166 -Node: Variable Scope588124 -Node: Pass By Value/Reference591118 -Node: Return Statement594617 -Node: Dynamic Typing597596 -Node: Indirect Calls598526 -Ref: Indirect Calls-Footnote-1608777 -Node: Functions Summary608905 -Node: Library Functions611610 -Ref: Library Functions-Footnote-1615219 -Ref: Library Functions-Footnote-2615362 -Node: Library Names615533 -Ref: Library Names-Footnote-1618994 -Ref: Library Names-Footnote-2619217 -Node: General Functions619303 -Node: Strtonum Function620406 -Node: Assert Function623428 -Node: Round Function626754 -Node: Cliff Random Function628295 -Node: Ordinal Functions629311 -Ref: Ordinal Functions-Footnote-1632374 -Ref: Ordinal Functions-Footnote-2632626 -Node: Join Function632836 -Ref: Join Function-Footnote-1634606 -Node: Getlocaltime Function634806 -Node: Readfile Function638550 -Node: Shell Quoting640524 -Node: Data File Management641925 -Node: Filetrans Function642557 -Node: Rewind Function646654 -Node: File Checking648040 -Ref: File Checking-Footnote-1649374 -Node: Empty Files649575 -Node: Ignoring Assigns651554 -Node: Getopt Function653104 -Ref: Getopt Function-Footnote-1664574 -Node: Passwd Functions664774 -Ref: Passwd Functions-Footnote-1673615 -Node: Group Functions673703 -Ref: Group Functions-Footnote-1681602 -Node: Walking Arrays681809 -Node: Library Functions Summary684819 -Node: Library Exercises686225 -Node: Sample Programs686690 -Node: Running Examples687460 -Node: Clones688188 -Node: Cut Program689412 -Node: Egrep Program699133 -Ref: Egrep Program-Footnote-1706645 -Node: Id Program706755 -Node: Split Program710435 -Ref: Split Program-Footnote-1713894 -Node: Tee Program714023 -Node: Uniq Program716813 -Node: Wc Program724239 -Ref: Wc Program-Footnote-1728494 -Node: Miscellaneous Programs728588 -Node: Dupword Program729801 -Node: Alarm Program731831 -Node: Translate Program736686 -Ref: Translate Program-Footnote-1741251 -Node: Labels Program741521 -Ref: Labels Program-Footnote-1744872 -Node: Word Sorting744956 -Node: History Sorting749028 -Node: Extract Program750863 -Node: Simple Sed758392 -Node: Igawk Program761466 -Ref: Igawk Program-Footnote-1775797 -Ref: Igawk Program-Footnote-2775999 -Ref: Igawk Program-Footnote-3776121 -Node: Anagram Program776236 -Node: Signature Program779298 -Node: Programs Summary780545 -Node: Programs Exercises781760 -Ref: Programs Exercises-Footnote-1785889 -Node: Advanced Features785980 -Node: Nondecimal Data787970 -Node: Array Sorting789561 -Node: Controlling Array Traversal790261 -Ref: Controlling Array Traversal-Footnote-1798630 -Node: Array Sorting Functions798748 -Ref: Array Sorting Functions-Footnote-1803839 -Node: Two-way I/O804035 -Ref: Two-way I/O-Footnote-1808986 -Ref: Two-way I/O-Footnote-2809173 -Node: TCP/IP Networking809255 -Node: Profiling812373 -Node: Advanced Features Summary820644 -Node: Internationalization822488 -Node: I18N and L10N823968 -Node: Explaining gettext824655 -Ref: Explaining gettext-Footnote-1829678 -Ref: Explaining gettext-Footnote-2829863 -Node: Programmer i18n830028 -Ref: Programmer i18n-Footnote-1834884 -Node: Translator i18n834933 -Node: String Extraction835727 -Ref: String Extraction-Footnote-1836860 -Node: Printf Ordering836946 -Ref: Printf Ordering-Footnote-1839732 -Node: I18N Portability839796 -Ref: I18N Portability-Footnote-1842252 -Node: I18N Example842315 -Ref: I18N Example-Footnote-1845121 -Node: Gawk I18N845194 -Node: I18N Summary845839 -Node: Debugger847180 -Node: Debugging848202 -Node: Debugging Concepts848643 -Node: Debugging Terms850452 -Node: Awk Debugging853027 -Node: Sample Debugging Session853933 -Node: Debugger Invocation854467 -Node: Finding The Bug855853 -Node: List of Debugger Commands862331 -Node: Breakpoint Control863664 -Node: Debugger Execution Control867358 -Node: Viewing And Changing Data870720 -Node: Execution Stack874094 -Node: Debugger Info875731 -Node: Miscellaneous Debugger Commands879802 -Node: Readline Support884890 -Node: Limitations885786 -Ref: Limitations-Footnote-1890017 -Node: Debugging Summary890068 -Node: Arbitrary Precision Arithmetic891347 -Node: Computer Arithmetic892763 -Ref: table-numeric-ranges896354 -Ref: Computer Arithmetic-Footnote-1897076 -Node: Math Definitions897133 -Ref: table-ieee-formats900447 -Ref: Math Definitions-Footnote-1901050 -Node: MPFR features901155 -Node: FP Math Caution902828 -Ref: FP Math Caution-Footnote-1903900 -Node: Inexactness of computations904269 -Node: Inexact representation905229 -Node: Comparing FP Values906589 -Node: Errors accumulate907671 -Node: Getting Accuracy909104 -Node: Try To Round911814 -Node: Setting precision912713 -Ref: table-predefined-precision-strings913410 -Node: Setting the rounding mode915240 -Ref: table-gawk-rounding-modes915614 -Ref: Setting the rounding mode-Footnote-1919022 -Node: Arbitrary Precision Integers919201 -Ref: Arbitrary Precision Integers-Footnote-1924118 -Node: POSIX Floating Point Problems924267 -Ref: POSIX Floating Point Problems-Footnote-1928149 -Node: Floating point summary928187 -Node: Dynamic Extensions930377 -Node: Extension Intro931930 -Node: Plugin License933196 -Node: Extension Mechanism Outline933993 -Ref: figure-load-extension934432 -Ref: figure-register-new-function935997 -Ref: figure-call-new-function937089 -Node: Extension API Description939152 -Node: Extension API Functions Introduction940684 -Node: General Data Types945543 -Ref: General Data Types-Footnote-1951498 -Node: Memory Allocation Functions951797 -Ref: Memory Allocation Functions-Footnote-1954642 -Node: Constructor Functions954741 -Node: Registration Functions956486 -Node: Extension Functions957171 -Node: Exit Callback Functions959470 -Node: Extension Version String960720 -Node: Input Parsers961383 -Node: Output Wrappers971268 -Node: Two-way processors975780 -Node: Printing Messages978044 -Ref: Printing Messages-Footnote-1979118 -Node: Updating ERRNO979271 -Node: Requesting Values980010 -Ref: table-value-types-returned980747 -Node: Accessing Parameters981630 -Node: Symbol Table Access982866 -Node: Symbol table by name983378 -Node: Symbol table by cookie985399 -Ref: Symbol table by cookie-Footnote-1989548 -Node: Cached values989612 -Ref: Cached values-Footnote-1993113 -Node: Array Manipulation993204 -Ref: Array Manipulation-Footnote-1994295 -Node: Array Data Types994332 -Ref: Array Data Types-Footnote-1996990 -Node: Array Functions997082 -Node: Flattening Arrays1000941 -Node: Creating Arrays1007849 -Node: Redirection API1012621 -Node: Extension API Variables1015452 -Node: Extension Versioning1016085 -Node: Extension API Informational Variables1017976 -Node: Extension API Boilerplate1019040 -Node: Finding Extensions1022854 -Node: Extension Example1023414 -Node: Internal File Description1024212 -Node: Internal File Ops1028292 -Ref: Internal File Ops-Footnote-11040054 -Node: Using Internal File Ops1040194 -Ref: Using Internal File Ops-Footnote-11042577 -Node: Extension Samples1042852 -Node: Extension Sample File Functions1044381 -Node: Extension Sample Fnmatch1052030 -Node: Extension Sample Fork1053517 -Node: Extension Sample Inplace1054735 -Node: Extension Sample Ord1057945 -Node: Extension Sample Readdir1058781 -Ref: table-readdir-file-types1059670 -Node: Extension Sample Revout1060475 -Node: Extension Sample Rev2way1061064 -Node: Extension Sample Read write array1061804 -Node: Extension Sample Readfile1063746 -Node: Extension Sample Time1064841 -Node: Extension Sample API Tests1066189 -Node: gawkextlib1066681 -Node: Extension summary1069128 -Node: Extension Exercises1072820 -Node: Language History1074317 -Node: V7/SVR3.11075973 -Node: SVR41078125 -Node: POSIX1079559 -Node: BTL1080939 -Node: POSIX/GNU1081669 -Node: Feature History1087508 -Node: Common Extensions1101878 -Node: Ranges and Locales1103161 -Ref: Ranges and Locales-Footnote-11107777 -Ref: Ranges and Locales-Footnote-21107804 -Ref: Ranges and Locales-Footnote-31108039 -Node: Contributors1108260 -Node: History summary1113829 -Node: Installation1115209 -Node: Gawk Distribution1116154 -Node: Getting1116638 -Node: Extracting1117599 -Node: Distribution contents1119237 -Node: Unix Installation1125333 -Node: Quick Installation1126015 -Node: Shell Startup Files1128429 -Node: Additional Configuration Options1129507 -Node: Configuration Philosophy1131312 -Node: Non-Unix Installation1133682 -Node: PC Installation1134140 -Node: PC Binary Installation1135460 -Node: PC Compiling1137312 -Ref: PC Compiling-Footnote-11140336 -Node: PC Testing1140445 -Node: PC Using1141625 -Node: Cygwin1145739 -Node: MSYS1146509 -Node: VMS Installation1147010 -Node: VMS Compilation1147801 -Ref: VMS Compilation-Footnote-11149031 -Node: VMS Dynamic Extensions1149089 -Node: VMS Installation Details1150774 -Node: VMS Running1153027 -Node: VMS GNV1155868 -Node: VMS Old Gawk1156603 -Node: Bugs1157074 -Node: Other Versions1161271 -Node: Installation summary1167857 -Node: Notes1168915 -Node: Compatibility Mode1169780 -Node: Additions1170562 -Node: Accessing The Source1171487 -Node: Adding Code1172923 -Node: New Ports1179142 -Node: Derived Files1183630 -Ref: Derived Files-Footnote-11189115 -Ref: Derived Files-Footnote-21189150 -Ref: Derived Files-Footnote-31189748 -Node: Future Extensions1189862 -Node: Implementation Limitations1190520 -Node: Extension Design1191703 -Node: Old Extension Problems1192857 -Ref: Old Extension Problems-Footnote-11194375 -Node: Extension New Mechanism Goals1194432 -Ref: Extension New Mechanism Goals-Footnote-11197796 -Node: Extension Other Design Decisions1197985 -Node: Extension Future Growth1200098 -Node: Old Extension Mechanism1200934 -Node: Notes summary1202697 -Node: Basic Concepts1203879 -Node: Basic High Level1204560 -Ref: figure-general-flow1204842 -Ref: figure-process-flow1205527 -Ref: Basic High Level-Footnote-11208828 -Node: Basic Data Typing1209013 -Node: Glossary1212341 -Node: Copying1244287 -Node: GNU Free Documentation License1281826 -Node: Index1306944 +Node: Leftmost Longest176506 +Node: Computed Regexps177809 +Node: GNU Regexp Operators181236 +Node: Case-sensitivity184915 +Ref: Case-sensitivity-Footnote-1187811 +Ref: Case-sensitivity-Footnote-2188046 +Node: Strong Regexp Constants188154 +Node: Regexp Summary191096 +Node: Reading Files192702 +Node: Records194865 +Node: awk split records195598 +Node: gawk split records200530 +Ref: gawk split records-Footnote-1205074 +Node: Fields205111 +Node: Nonconstant Fields207852 +Ref: Nonconstant Fields-Footnote-1210088 +Node: Changing Fields210292 +Node: Field Separators216222 +Node: Default Field Splitting218920 +Node: Regexp Field Splitting220038 +Node: Single Character Fields223391 +Node: Command Line Field Separator224451 +Node: Full Line Fields227669 +Ref: Full Line Fields-Footnote-1229191 +Ref: Full Line Fields-Footnote-2229237 +Node: Field Splitting Summary229338 +Node: Constant Size231412 +Node: Splitting By Content235991 +Ref: Splitting By Content-Footnote-1239962 +Node: Multiple Line240125 +Ref: Multiple Line-Footnote-1246008 +Node: Getline246187 +Node: Plain Getline248654 +Node: Getline/Variable251293 +Node: Getline/File252442 +Node: Getline/Variable/File253828 +Ref: Getline/Variable/File-Footnote-1255432 +Node: Getline/Pipe255520 +Node: Getline/Variable/Pipe258225 +Node: Getline/Coprocess259358 +Node: Getline/Variable/Coprocess260623 +Node: Getline Notes261363 +Node: Getline Summary264158 +Ref: table-getline-variants264580 +Node: Read Timeout265328 +Ref: Read Timeout-Footnote-1269235 +Node: Retrying Input269293 +Node: Command-line directories270492 +Node: Input Summary271399 +Node: Input Exercises274571 +Node: Printing275299 +Node: Print277134 +Node: Print Examples278591 +Node: Output Separators281371 +Node: OFMT283388 +Node: Printf284744 +Node: Basic Printf285529 +Node: Control Letters287103 +Node: Format Modifiers291091 +Node: Printf Examples297106 +Node: Redirection299592 +Node: Special FD306435 +Ref: Special FD-Footnote-1309603 +Node: Special Files309677 +Node: Other Inherited Files310294 +Node: Special Network311295 +Node: Special Caveats312155 +Node: Close Files And Pipes313104 +Ref: Close Files And Pipes-Footnote-1320291 +Ref: Close Files And Pipes-Footnote-2320439 +Node: Nonfatal320590 +Node: Output Summary322915 +Node: Output Exercises324137 +Node: Expressions324816 +Node: Values326004 +Node: Constants326682 +Node: Scalar Constants327373 +Ref: Scalar Constants-Footnote-1328237 +Node: Nondecimal-numbers328487 +Node: Regexp Constants331501 +Node: Using Constant Regexps332027 +Node: Variables335190 +Node: Using Variables335847 +Node: Assignment Options337758 +Node: Conversion339632 +Node: Strings And Numbers340156 +Ref: Strings And Numbers-Footnote-1343220 +Node: Locale influences conversions343329 +Ref: table-locale-affects346087 +Node: All Operators346705 +Node: Arithmetic Ops347334 +Node: Concatenation349840 +Ref: Concatenation-Footnote-1352687 +Node: Assignment Ops352794 +Ref: table-assign-ops357786 +Node: Increment Ops359099 +Node: Truth Values and Conditions362559 +Node: Truth Values363633 +Node: Typing and Comparison364681 +Node: Variable Typing365501 +Node: Comparison Operators369125 +Ref: table-relational-ops369544 +Node: POSIX String Comparison373039 +Ref: POSIX String Comparison-Footnote-1374113 +Node: Boolean Ops374252 +Ref: Boolean Ops-Footnote-1378734 +Node: Conditional Exp378826 +Node: Function Calls380562 +Node: Precedence384442 +Node: Locales388101 +Node: Expressions Summary389733 +Node: Patterns and Actions392306 +Node: Pattern Overview393426 +Node: Regexp Patterns395103 +Node: Expression Patterns395645 +Node: Ranges399426 +Node: BEGIN/END402534 +Node: Using BEGIN/END403295 +Ref: Using BEGIN/END-Footnote-1406032 +Node: I/O And BEGIN/END406138 +Node: BEGINFILE/ENDFILE408454 +Node: Empty411361 +Node: Using Shell Variables411678 +Node: Action Overview413952 +Node: Statements416277 +Node: If Statement418125 +Node: While Statement419620 +Node: Do Statement421648 +Node: For Statement422796 +Node: Switch Statement425955 +Node: Break Statement428341 +Node: Continue Statement430433 +Node: Next Statement432260 +Node: Nextfile Statement434643 +Node: Exit Statement437295 +Node: Built-in Variables439700 +Node: User-modified440833 +Node: Auto-set448421 +Ref: Auto-set-Footnote-1462814 +Ref: Auto-set-Footnote-2463020 +Node: ARGC and ARGV463076 +Node: Pattern Action Summary467295 +Node: Arrays469725 +Node: Array Basics471054 +Node: Array Intro471898 +Ref: figure-array-elements473873 +Ref: Array Intro-Footnote-1476577 +Node: Reference to Elements476705 +Node: Assigning Elements479169 +Node: Array Example479660 +Node: Scanning an Array481419 +Node: Controlling Scanning484443 +Ref: Controlling Scanning-Footnote-1489842 +Node: Numeric Array Subscripts490158 +Node: Uninitialized Subscripts492342 +Node: Delete493961 +Ref: Delete-Footnote-1496713 +Node: Multidimensional496770 +Node: Multiscanning499865 +Node: Arrays of Arrays501456 +Node: Arrays Summary506224 +Node: Functions508317 +Node: Built-in509355 +Node: Calling Built-in510433 +Node: Numeric Functions512429 +Ref: Numeric Functions-Footnote-1517262 +Ref: Numeric Functions-Footnote-2517619 +Ref: Numeric Functions-Footnote-3517667 +Node: String Functions517939 +Ref: String Functions-Footnote-1541447 +Ref: String Functions-Footnote-2541576 +Ref: String Functions-Footnote-3541824 +Node: Gory Details541911 +Ref: table-sub-escapes543702 +Ref: table-sub-proposed545221 +Ref: table-posix-sub546584 +Ref: table-gensub-escapes548125 +Ref: Gory Details-Footnote-1548948 +Node: I/O Functions549099 +Ref: I/O Functions-Footnote-1556320 +Node: Time Functions556468 +Ref: Time Functions-Footnote-1566973 +Ref: Time Functions-Footnote-2567041 +Ref: Time Functions-Footnote-3567199 +Ref: Time Functions-Footnote-4567310 +Ref: Time Functions-Footnote-5567422 +Ref: Time Functions-Footnote-6567649 +Node: Bitwise Functions567915 +Ref: table-bitwise-ops568509 +Ref: Bitwise Functions-Footnote-1572847 +Node: Type Functions573020 +Node: I18N Functions575681 +Node: User-defined577332 +Node: Definition Syntax578137 +Ref: Definition Syntax-Footnote-1583824 +Node: Function Example583895 +Ref: Function Example-Footnote-1586817 +Node: Function Caveats586839 +Node: Calling A Function587357 +Node: Variable Scope588315 +Node: Pass By Value/Reference591309 +Node: Return Statement594808 +Node: Dynamic Typing597787 +Node: Indirect Calls598717 +Ref: Indirect Calls-Footnote-1608968 +Node: Functions Summary609096 +Node: Library Functions611801 +Ref: Library Functions-Footnote-1615410 +Ref: Library Functions-Footnote-2615553 +Node: Library Names615724 +Ref: Library Names-Footnote-1619185 +Ref: Library Names-Footnote-2619408 +Node: General Functions619494 +Node: Strtonum Function620597 +Node: Assert Function623619 +Node: Round Function626945 +Node: Cliff Random Function628486 +Node: Ordinal Functions629502 +Ref: Ordinal Functions-Footnote-1632565 +Ref: Ordinal Functions-Footnote-2632817 +Node: Join Function633027 +Ref: Join Function-Footnote-1634797 +Node: Getlocaltime Function634997 +Node: Readfile Function638741 +Node: Shell Quoting640715 +Node: Data File Management642116 +Node: Filetrans Function642748 +Node: Rewind Function646845 +Node: File Checking648231 +Ref: File Checking-Footnote-1649565 +Node: Empty Files649766 +Node: Ignoring Assigns651745 +Node: Getopt Function653295 +Ref: Getopt Function-Footnote-1664765 +Node: Passwd Functions664965 +Ref: Passwd Functions-Footnote-1673806 +Node: Group Functions673894 +Ref: Group Functions-Footnote-1681793 +Node: Walking Arrays682000 +Node: Library Functions Summary685010 +Node: Library Exercises686416 +Node: Sample Programs686881 +Node: Running Examples687651 +Node: Clones688379 +Node: Cut Program689603 +Node: Egrep Program699324 +Ref: Egrep Program-Footnote-1706836 +Node: Id Program706946 +Node: Split Program710626 +Ref: Split Program-Footnote-1714085 +Node: Tee Program714214 +Node: Uniq Program717004 +Node: Wc Program724430 +Ref: Wc Program-Footnote-1728685 +Node: Miscellaneous Programs728779 +Node: Dupword Program729992 +Node: Alarm Program732022 +Node: Translate Program736877 +Ref: Translate Program-Footnote-1741442 +Node: Labels Program741712 +Ref: Labels Program-Footnote-1745063 +Node: Word Sorting745147 +Node: History Sorting749219 +Node: Extract Program751054 +Node: Simple Sed758583 +Node: Igawk Program761657 +Ref: Igawk Program-Footnote-1775988 +Ref: Igawk Program-Footnote-2776190 +Ref: Igawk Program-Footnote-3776312 +Node: Anagram Program776427 +Node: Signature Program779489 +Node: Programs Summary780736 +Node: Programs Exercises781951 +Ref: Programs Exercises-Footnote-1786080 +Node: Advanced Features786171 +Node: Nondecimal Data788161 +Node: Array Sorting789752 +Node: Controlling Array Traversal790452 +Ref: Controlling Array Traversal-Footnote-1798821 +Node: Array Sorting Functions798939 +Ref: Array Sorting Functions-Footnote-1804030 +Node: Two-way I/O804226 +Ref: Two-way I/O-Footnote-1810046 +Ref: Two-way I/O-Footnote-2810233 +Node: TCP/IP Networking810315 +Node: Profiling813433 +Node: Advanced Features Summary821704 +Node: Internationalization823548 +Node: I18N and L10N825028 +Node: Explaining gettext825715 +Ref: Explaining gettext-Footnote-1830738 +Ref: Explaining gettext-Footnote-2830923 +Node: Programmer i18n831088 +Ref: Programmer i18n-Footnote-1835944 +Node: Translator i18n835993 +Node: String Extraction836787 +Ref: String Extraction-Footnote-1837920 +Node: Printf Ordering838006 +Ref: Printf Ordering-Footnote-1840792 +Node: I18N Portability840856 +Ref: I18N Portability-Footnote-1843312 +Node: I18N Example843375 +Ref: I18N Example-Footnote-1846181 +Node: Gawk I18N846254 +Node: I18N Summary846899 +Node: Debugger848240 +Node: Debugging849262 +Node: Debugging Concepts849703 +Node: Debugging Terms851512 +Node: Awk Debugging854087 +Node: Sample Debugging Session854993 +Node: Debugger Invocation855527 +Node: Finding The Bug856913 +Node: List of Debugger Commands863391 +Node: Breakpoint Control864724 +Node: Debugger Execution Control868418 +Node: Viewing And Changing Data871780 +Node: Execution Stack875154 +Node: Debugger Info876791 +Node: Miscellaneous Debugger Commands880862 +Node: Readline Support885950 +Node: Limitations886846 +Ref: Limitations-Footnote-1891077 +Node: Debugging Summary891128 +Node: Arbitrary Precision Arithmetic892407 +Node: Computer Arithmetic893823 +Ref: table-numeric-ranges897414 +Ref: Computer Arithmetic-Footnote-1898136 +Node: Math Definitions898193 +Ref: table-ieee-formats901507 +Ref: Math Definitions-Footnote-1902110 +Node: MPFR features902215 +Node: FP Math Caution903888 +Ref: FP Math Caution-Footnote-1904960 +Node: Inexactness of computations905329 +Node: Inexact representation906289 +Node: Comparing FP Values907649 +Node: Errors accumulate908731 +Node: Getting Accuracy910164 +Node: Try To Round912874 +Node: Setting precision913773 +Ref: table-predefined-precision-strings914470 +Node: Setting the rounding mode916300 +Ref: table-gawk-rounding-modes916674 +Ref: Setting the rounding mode-Footnote-1920082 +Node: Arbitrary Precision Integers920261 +Ref: Arbitrary Precision Integers-Footnote-1925178 +Node: POSIX Floating Point Problems925327 +Ref: POSIX Floating Point Problems-Footnote-1929209 +Node: Floating point summary929247 +Node: Dynamic Extensions931437 +Node: Extension Intro932990 +Node: Plugin License934256 +Node: Extension Mechanism Outline935053 +Ref: figure-load-extension935492 +Ref: figure-register-new-function937057 +Ref: figure-call-new-function938149 +Node: Extension API Description940212 +Node: Extension API Functions Introduction941744 +Node: General Data Types946603 +Ref: General Data Types-Footnote-1952558 +Node: Memory Allocation Functions952857 +Ref: Memory Allocation Functions-Footnote-1955702 +Node: Constructor Functions955801 +Node: Registration Functions957546 +Node: Extension Functions958231 +Node: Exit Callback Functions960530 +Node: Extension Version String961780 +Node: Input Parsers962443 +Node: Output Wrappers972328 +Node: Two-way processors976840 +Node: Printing Messages979104 +Ref: Printing Messages-Footnote-1980178 +Node: Updating ERRNO980331 +Node: Requesting Values981070 +Ref: table-value-types-returned981807 +Node: Accessing Parameters982690 +Node: Symbol Table Access983926 +Node: Symbol table by name984438 +Node: Symbol table by cookie986459 +Ref: Symbol table by cookie-Footnote-1990608 +Node: Cached values990672 +Ref: Cached values-Footnote-1994173 +Node: Array Manipulation994264 +Ref: Array Manipulation-Footnote-1995355 +Node: Array Data Types995392 +Ref: Array Data Types-Footnote-1998050 +Node: Array Functions998142 +Node: Flattening Arrays1002001 +Node: Creating Arrays1008909 +Node: Redirection API1013681 +Node: Extension API Variables1016512 +Node: Extension Versioning1017145 +Node: Extension API Informational Variables1019036 +Node: Extension API Boilerplate1020100 +Node: Finding Extensions1023914 +Node: Extension Example1024474 +Node: Internal File Description1025272 +Node: Internal File Ops1029352 +Ref: Internal File Ops-Footnote-11041114 +Node: Using Internal File Ops1041254 +Ref: Using Internal File Ops-Footnote-11043637 +Node: Extension Samples1043912 +Node: Extension Sample File Functions1045441 +Node: Extension Sample Fnmatch1053090 +Node: Extension Sample Fork1054577 +Node: Extension Sample Inplace1055795 +Node: Extension Sample Ord1059005 +Node: Extension Sample Readdir1059841 +Ref: table-readdir-file-types1060730 +Node: Extension Sample Revout1061535 +Node: Extension Sample Rev2way1062124 +Node: Extension Sample Read write array1062864 +Node: Extension Sample Readfile1064806 +Node: Extension Sample Time1065901 +Node: Extension Sample API Tests1067249 +Node: gawkextlib1067741 +Node: Extension summary1070188 +Node: Extension Exercises1073880 +Node: Language History1075377 +Node: V7/SVR3.11077033 +Node: SVR41079185 +Node: POSIX1080619 +Node: BTL1081999 +Node: POSIX/GNU1082729 +Node: Feature History1088568 +Node: Common Extensions1102938 +Node: Ranges and Locales1104221 +Ref: Ranges and Locales-Footnote-11108837 +Ref: Ranges and Locales-Footnote-21108864 +Ref: Ranges and Locales-Footnote-31109099 +Node: Contributors1109320 +Node: History summary1114889 +Node: Installation1116269 +Node: Gawk Distribution1117214 +Node: Getting1117698 +Node: Extracting1118659 +Node: Distribution contents1120297 +Node: Unix Installation1126393 +Node: Quick Installation1127075 +Node: Shell Startup Files1129489 +Node: Additional Configuration Options1130567 +Node: Configuration Philosophy1132372 +Node: Non-Unix Installation1134742 +Node: PC Installation1135200 +Node: PC Binary Installation1136520 +Node: PC Compiling1138372 +Ref: PC Compiling-Footnote-11141396 +Node: PC Testing1141505 +Node: PC Using1142685 +Node: Cygwin1146799 +Node: MSYS1147569 +Node: VMS Installation1148070 +Node: VMS Compilation1148861 +Ref: VMS Compilation-Footnote-11150091 +Node: VMS Dynamic Extensions1150149 +Node: VMS Installation Details1151834 +Node: VMS Running1154087 +Node: VMS GNV1156928 +Node: VMS Old Gawk1157663 +Node: Bugs1158134 +Node: Other Versions1162331 +Node: Installation summary1168917 +Node: Notes1169975 +Node: Compatibility Mode1170840 +Node: Additions1171622 +Node: Accessing The Source1172547 +Node: Adding Code1173983 +Node: New Ports1180202 +Node: Derived Files1184690 +Ref: Derived Files-Footnote-11190175 +Ref: Derived Files-Footnote-21190210 +Ref: Derived Files-Footnote-31190808 +Node: Future Extensions1190922 +Node: Implementation Limitations1191580 +Node: Extension Design1192763 +Node: Old Extension Problems1193917 +Ref: Old Extension Problems-Footnote-11195435 +Node: Extension New Mechanism Goals1195492 +Ref: Extension New Mechanism Goals-Footnote-11198856 +Node: Extension Other Design Decisions1199045 +Node: Extension Future Growth1201158 +Node: Old Extension Mechanism1201994 +Node: Notes summary1203757 +Node: Basic Concepts1204939 +Node: Basic High Level1205620 +Ref: figure-general-flow1205902 +Ref: figure-process-flow1206587 +Ref: Basic High Level-Footnote-11209888 +Node: Basic Data Typing1210073 +Node: Glossary1213401 +Node: Copying1245347 +Node: GNU Free Documentation License1282886 +Node: Index1308004 End Tag Table diff --git a/doc/gawk.texi b/doc/gawk.texi index 715ac862..a5b163df 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -5803,6 +5803,10 @@ they do not recognize collating symbols or equivalence classes. @end quotation @c maybe one day ... +Inside a bracket expression, an opening bracket (@samp{[}) that does +not start a character class, collating element or equivalence class is +taken literally. This is also true of @samp{.} and @samp{*}. + @node Leftmost Longest @section How Much Text Matches? @@ -27804,10 +27808,27 @@ print @dots{} |& command # start two-way pipe @end example @noindent -Using ptys usually avoids the buffer deadlock issues described earlier, at some -loss in performance. If your system does not have ptys, or if all the -system's ptys are in use, @command{gawk} automatically falls back to -using regular pipes. +If your system does not have ptys, or if all the system's ptys are in use, +@command{gawk} automatically falls back to using regular pipes. + +Using ptys usually avoids the buffer deadlock issues described earlier, +at some loss in performance. This is because the tty driver buffers +and sends data line-by-line. On systems with the @command{stdbuf} +(part of the @uref{http://www.gnu.org/software/coreutils/coreutils.html, +GNU Coreutils package}), you can use that program instead of ptys. + +Note also that ptys are not fully transparent. Certain binary control +codes, such @kbd{Ctrl-d} for end-of-file, are interpreted by the tty +driver and not passed through. + +@quotation CAUTION +Finally, coprocesses open up the possibility of @dfn{deadlock} between +@command{gawk} and the program running in the coprocess. This can occur +if you send ``too much'' data to the coprocess before reading any back; +each process is blocked writing data with noone available to read what +they've already written. There is no workaround for deadlock; careful +programming and knowledge of the behavior of the coprocess are required. +@end quotation @node TCP/IP Networking @section Using @command{gawk} for Network Programming diff --git a/doc/gawktexi.in b/doc/gawktexi.in index dde24353..129579a6 100644 --- a/doc/gawktexi.in +++ b/doc/gawktexi.in @@ -5631,6 +5631,10 @@ they do not recognize collating symbols or equivalence classes. @end quotation @c maybe one day ... +Inside a bracket expression, an opening bracket (@samp{[}) that does +not start a character class, collating element or equivalence class is +taken literally. This is also true of @samp{.} and @samp{*}. + @node Leftmost Longest @section How Much Text Matches? @@ -26895,10 +26899,27 @@ print @dots{} |& command # start two-way pipe @end example @noindent -Using ptys usually avoids the buffer deadlock issues described earlier, at some -loss in performance. If your system does not have ptys, or if all the -system's ptys are in use, @command{gawk} automatically falls back to -using regular pipes. +If your system does not have ptys, or if all the system's ptys are in use, +@command{gawk} automatically falls back to using regular pipes. + +Using ptys usually avoids the buffer deadlock issues described earlier, +at some loss in performance. This is because the tty driver buffers +and sends data line-by-line. On systems with the @command{stdbuf} +(part of the @uref{http://www.gnu.org/software/coreutils/coreutils.html, +GNU Coreutils package}), you can use that program instead of ptys. + +Note also that ptys are not fully transparent. Certain binary control +codes, such @kbd{Ctrl-d} for end-of-file, are interpreted by the tty +driver and not passed through. + +@quotation CAUTION +Finally, coprocesses open up the possibility of @dfn{deadlock} between +@command{gawk} and the program running in the coprocess. This can occur +if you send ``too much'' data to the coprocess before reading any back; +each process is blocked writing data with noone available to read what +they've already written. There is no workaround for deadlock; careful +programming and knowledge of the behavior of the coprocess are required. +@end quotation @node TCP/IP Networking @section Using @command{gawk} for Network Programming @@ -137,7 +137,7 @@ static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node); POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ -const char __re_error_msgid[] attribute_hidden = +static const char __re_error_msgid[] attribute_hidden = { #define REG_NOERROR_IDX 0 gettext_noop ("Success") /* REG_NOERROR */ @@ -191,7 +191,7 @@ const char __re_error_msgid[] attribute_hidden = gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */ }; -const size_t __re_error_msgid_idx[] attribute_hidden = +static const size_t __re_error_msgid_idx[] attribute_hidden = { REG_NOERROR_IDX, REG_NOMATCH_IDX, @@ -345,7 +345,8 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, #ifdef RE_ENABLE_I18N if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1) { - unsigned char *buf = re_malloc (unsigned char, dfa->mb_cur_max), *p; + unsigned char buf[MB_LEN_MAX]; + unsigned char *p; wchar_t wc; mbstate_t state; @@ -361,7 +362,6 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, && (__wcrtomb ((char *) buf, towlower (wc), &state) != (size_t) -1)) re_set_fastmap (fastmap, 0, buf[0]); - re_free (buf); } #endif } @@ -809,7 +809,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length, __libc_lock_init (dfa->lock); err = re_string_construct (®exp, pattern, length, preg->translate, - syntax & RE_ICASE, dfa); + (syntax & RE_ICASE) != 0, dfa); if (BE (err != REG_NOERROR, 0)) { re_compile_internal_free_return: @@ -2194,6 +2194,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, { re_dfa_t *dfa = (re_dfa_t *) preg->buffer; bin_tree_t *tree, *branch = NULL; + bitset_word_t initial_bkref_map = dfa->completed_bkref_map; tree = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && tree == NULL, 0)) return NULL; @@ -2204,6 +2205,8 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, if (token->type != OP_ALT && token->type != END_OF_RE && (nest == 0 || token->type != OP_CLOSE_SUBEXP)) { + bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map; + dfa->completed_bkref_map = initial_bkref_map; branch = parse_branch (regexp, preg, token, syntax, nest, err); if (BE (*err != REG_NOERROR && branch == NULL, 0)) { @@ -2211,6 +2214,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, postorder (tree, free_tree, NULL); return NULL; } + dfa->completed_bkref_map |= accumulated_bkref_map; } else branch = NULL; @@ -2741,7 +2745,7 @@ build_range_exp (reg_syntax_t syntax, bitset_t sbcset, #endif if (start_wc == WEOF || end_wc == WEOF) return REG_ECOLLATE; - else if ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc) + else if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc, 0)) return REG_ERANGE; /* Got valid collation sequence values, add them as a new entry. @@ -3509,7 +3513,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name) /* This isn't a valid character. */ return REG_ECOLLATE; - /* Build single byte matcing table for this equivalence class. */ + /* Build single byte matching table for this equivalence class. */ char_buf[1] = (unsigned char) '\0'; len = weights[idx1 & 0xffffff]; for (ch = 0; ch < SBC_MAX; ++ch) @@ -327,7 +327,7 @@ typedef enum /* POSIX regcomp return error codes. (In the order listed in the standard.) */ REG_BADPAT, /* Invalid pattern. */ - REG_ECOLLATE, /* Inalid collating element. */ + REG_ECOLLATE, /* Invalid collating element. */ REG_ECTYPE, /* Invalid character class name. */ REG_EESCAPE, /* Trailing backslash. */ REG_ESUBREG, /* Invalid back reference. */ diff --git a/regex_internal.c b/regex_internal.c index fcfa4ada..2d170932 100644 --- a/regex_internal.c +++ b/regex_internal.c @@ -1632,7 +1632,7 @@ free_state (re_dfastate_t *state) re_free (state); } -/* Create the new state which is independ of contexts. +/* Create the new state which is independent of contexts. Return the new state if succeeded, otherwise return NULL. */ static re_dfastate_t * diff --git a/regex_internal.h b/regex_internal.h index 9e104d8d..6cc84a79 100644 --- a/regex_internal.h +++ b/regex_internal.h @@ -159,9 +159,6 @@ is_blank (int c) # define __attribute_warn_unused_result__ #endif -extern const char __re_error_msgid[] attribute_hidden; -extern const size_t __re_error_msgid_idx[] attribute_hidden; - /* An integer used to represent a set of bits. It must be unsigned, and must be at least as wide as unsigned int. */ typedef unsigned long int bitset_word_t; @@ -774,7 +771,7 @@ bitset_mask (bitset_t dest, const bitset_t src) } #ifdef RE_ENABLE_I18N -/* Inline functions for re_string. */ +/* Functions for re_string. */ static int internal_function __attribute__ ((pure, unused)) re_string_char_size_at (const re_string_t *pstr, int idx) @@ -306,7 +306,7 @@ compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0); concerned. If REGS is not NULL, and BUFP->no_sub is not set, the offsets of the match - and all groups is stroed in REGS. (For the "_2" variants, the offsets are + and all groups is stored in REGS. (For the "_2" variants, the offsets are computed relative to the concatenation, not relative to the individual strings.) @@ -627,7 +627,7 @@ re_exec (s) /* Searches for a compiled pattern PREG in the string STRING, whose length is LENGTH. NMATCH, PMATCH, and EFLAGS have the same - mingings with regexec. START, and RANGE have the same meanings + meaning as with regexec. START, and RANGE have the same meanings with re_search. Return REG_NOERROR if we find a match, and REG_NOMATCH if not, otherwise return the error code. @@ -695,7 +695,8 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch, fl_longest_match = (nmatch != 0 || dfa->nbackref); err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1, - preg->translate, preg->syntax & RE_ICASE, dfa); + preg->translate, (preg->syntax & RE_ICASE) != 0, + dfa); if (BE (err != REG_NOERROR, 0)) goto free_return; mctx.input.stop = stop; @@ -912,7 +913,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch, goto free_return; } - /* At last, add the offset to the each registers, since we slided + /* At last, add the offset to each register, since we slid the buffers so that we could assume that the matching starts from 0. */ for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) @@ -963,8 +964,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch, static reg_errcode_t __attribute_warn_unused_result__ -prune_impossible_nodes (mctx) - re_match_context_t *mctx; +prune_impossible_nodes (re_match_context_t *mctx) { const re_dfa_t *const dfa = mctx->dfa; int halt_node, match_last; @@ -2420,7 +2420,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx, /* Skip bytes in the input that correspond to part of a multi-byte match, then look in the log for a state from which to restart matching. */ -re_dfastate_t * +static re_dfastate_t * internal_function find_recover_state (reg_errcode_t *err, re_match_context_t *mctx) { @@ -2449,7 +2449,7 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx) /* From the node set CUR_NODES, pick up the nodes whose types are OP_OPEN_SUBEXP and which have corresponding back references in the regular expression. And register them to use them later for evaluating the - correspoding back references. */ + corresponding back references. */ static reg_errcode_t internal_function |