summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì <pot@gnu.org>2001-05-14 12:57:11 +0000
committerFrancesco Potortì <pot@gnu.org>2001-05-14 12:57:11 +0000
commit7e88eb250e6eb9eb4d69e81ebfafa3fad33bca31 (patch)
treed792a9cb019bf60b05337fb30522385e3a59c697 /lib-src
parent2e98c9c87f37c3869f814edf4a2685161709e9dc (diff)
(add_regex): Reset the whole newly allocated pattern buffer instead of
the individual members. It's safer and works with Xemacs.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index cf22f3ffc9d..def6f56c8d4 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -32,7 +32,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
* Francesco Potortì <pot@gnu.org> has maintained it since 1993.
*/
-char pot_etags_version[] = "@(#) pot revision number is 14.18";
+char pot_etags_version[] = "@(#) pot revision number is 14.20";
#define TRUE 1
#define FALSE 0
@@ -5155,6 +5155,7 @@ add_regex (regexp_pattern, ignore_case, lang)
bool ignore_case;
language *lang;
{
+ static struct re_pattern_buffer zeropattern;
char *name;
const char *err;
struct re_pattern_buffer *patbuf;
@@ -5175,11 +5176,9 @@ add_regex (regexp_pattern, ignore_case, lang)
(void) scan_separators (name);
patbuf = xnew (1, struct re_pattern_buffer);
- /* Translation table to fold case if appropriate. */
- patbuf->translate = (ignore_case) ? lc_trans : NULL;
- patbuf->fastmap = NULL;
- patbuf->buffer = NULL;
- patbuf->allocated = 0;
+ *patbuf = zeropattern;
+ if (ignore_case)
+ patbuf->translate = lc_trans; /* translation table to fold case */
err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf);
if (err != NULL)