mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
4.7 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/glibc/glibc23/regcomp-fixes-post233.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2005 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- ./posix/regcomp.c 2003/12/16 06:10:51 1.68
  20. +++ ./posix/regcomp.c 2003/12/22 06:45:04 1.69
  21. @@ -1157,7 +1157,7 @@
  22. case OP_CLOSE_EQUIV_CLASS:
  23. case OP_OPEN_CHAR_CLASS:
  24. case OP_CLOSE_CHAR_CLASS:
  25. - /* These must not be appeared here. */
  26. + /* These must not appear here. */
  27. assert (0);
  28. #endif
  29. case END_OF_RE:
  30. @@ -1336,8 +1336,6 @@
  31. if (BE (err != REG_NOERROR, 0))
  32. return err;
  33. dfa->nexts[clone_node] = dfa->nexts[org_node];
  34. - if (clone_dest == -1)
  35. - break;
  36. ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
  37. if (BE (ret < 0, 0))
  38. return REG_ESPACE;
  39. @@ -1375,8 +1373,6 @@
  40. err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
  41. if (BE (err != REG_NOERROR, 0))
  42. return err;
  43. - if (clone_dest == -1)
  44. - break;
  45. ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
  46. if (BE (ret < 0, 0))
  47. return REG_ESPACE;
  48. @@ -1395,16 +1391,13 @@
  49. err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
  50. if (BE (err != REG_NOERROR, 0))
  51. return err;
  52. - if (clone_dest != -1)
  53. - {
  54. - ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
  55. - if (BE (ret < 0, 0))
  56. - return REG_ESPACE;
  57. - err = duplicate_node_closure (dfa, org_dest, clone_dest,
  58. - root_node, constraint);
  59. - if (BE (err != REG_NOERROR, 0))
  60. - return err;
  61. - }
  62. + ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
  63. + if (BE (ret < 0, 0))
  64. + return REG_ESPACE;
  65. + err = duplicate_node_closure (dfa, org_dest, clone_dest,
  66. + root_node, constraint);
  67. + if (BE (err != REG_NOERROR, 0))
  68. + return err;
  69. }
  70. else
  71. {
  72. @@ -1419,8 +1412,6 @@
  73. err = duplicate_node (&clone_dest, dfa, org_dest, constraint);
  74. if (BE (err != REG_NOERROR, 0))
  75. return err;
  76. - if (clone_dest == -1)
  77. - break;
  78. ret = re_node_set_insert (dfa->edests + clone_node, clone_dest);
  79. if (BE (ret < 0, 0))
  80. return REG_ESPACE;
  81. @@ -1460,21 +1451,7 @@
  82. int *new_idx, org_idx;
  83. unsigned int constraint;
  84. {
  85. - int dup_idx;
  86. -
  87. - if (dfa->nodes[org_idx].type == CHARACTER
  88. - && (((constraint & NEXT_WORD_CONSTRAINT)
  89. - && !dfa->nodes[org_idx].word_char)
  90. - || ((constraint & NEXT_NOTWORD_CONSTRAINT)
  91. - && dfa->nodes[org_idx].word_char)))
  92. - {
  93. - /* \<!, \>W etc. can never match. Don't duplicate them, instead
  94. - tell the caller they shouldn't be added to edests. */
  95. - *new_idx = -1;
  96. - return REG_NOERROR;
  97. - }
  98. -
  99. - dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx], 1);
  100. + int dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx], 1);
  101. if (BE (dup_idx == -1, 0))
  102. return REG_ESPACE;
  103. dfa->nodes[dup_idx].constraint = constraint;
  104. @@ -2443,23 +2420,23 @@
  105. else
  106. goto parse_dup_op_ebrace;
  107. }
  108. - if (BE (start == 0 && end == 0, 0))
  109. + if (BE ((start == 0 && end == 0) || tree == NULL, 0))
  110. {
  111. - /* We treat "<re>{0}" and "<re>{0,0}" as null string. */
  112. + /* We treat "<re>{0}" and "<re>{0,0}" as null string.
  113. + Similarly "<re>{0}{m,n}". */
  114. fetch_token (token, regexp, syntax);
  115. return NULL;
  116. }
  117. /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}". */
  118. elem = tree;
  119. - for (i = 0; i < start; ++i)
  120. - if (i != 0)
  121. - {
  122. - work_tree = duplicate_tree (elem, dfa);
  123. - tree = create_tree (dfa, tree, work_tree, CONCAT, 0);
  124. - if (BE (work_tree == NULL || tree == NULL, 0))
  125. - goto parse_dup_op_espace;
  126. - }
  127. + for (i = 1; i < start; ++i)
  128. + {
  129. + work_tree = duplicate_tree (elem, dfa);
  130. + tree = create_tree (dfa, tree, work_tree, CONCAT, 0);
  131. + if (BE (work_tree == NULL || tree == NULL, 0))
  132. + goto parse_dup_op_espace;
  133. + }
  134. if (end == -1)
  135. {
  136. @@ -2516,6 +2493,9 @@
  137. }
  138. }
  139. }
  140. + /* Treat "<re>{0}*" etc. as "<re>{0}". */
  141. + else if (tree == NULL)
  142. + ;
  143. else
  144. {
  145. tree = re_dfa_add_tree_node (dfa, tree, NULL, token);