diff options
| author | Francesco Potortì | 2001-05-14 12:57:11 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2001-05-14 12:57:11 +0000 |
| commit | 7e88eb250e6eb9eb4d69e81ebfafa3fad33bca31 (patch) | |
| tree | d792a9cb019bf60b05337fb30522385e3a59c697 | |
| parent | 2e98c9c87f37c3869f814edf4a2685161709e9dc (diff) | |
| download | emacs-7e88eb250e6eb9eb4d69e81ebfafa3fad33bca31.tar.gz emacs-7e88eb250e6eb9eb4d69e81ebfafa3fad33bca31.zip | |
(add_regex): Reset the whole newly allocated pattern buffer instead of
the individual members. It's safer and works with Xemacs.
| -rw-r--r-- | lib-src/etags.c | 11 |
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. */ | |||
| 32 | * Francesco Potortì <pot@gnu.org> has maintained it since 1993. | 32 | * Francesco Potortì <pot@gnu.org> has maintained it since 1993. |
| 33 | */ | 33 | */ |
| 34 | 34 | ||
| 35 | char pot_etags_version[] = "@(#) pot revision number is 14.18"; | 35 | char pot_etags_version[] = "@(#) pot revision number is 14.20"; |
| 36 | 36 | ||
| 37 | #define TRUE 1 | 37 | #define TRUE 1 |
| 38 | #define FALSE 0 | 38 | #define FALSE 0 |
| @@ -5155,6 +5155,7 @@ add_regex (regexp_pattern, ignore_case, lang) | |||
| 5155 | bool ignore_case; | 5155 | bool ignore_case; |
| 5156 | language *lang; | 5156 | language *lang; |
| 5157 | { | 5157 | { |
| 5158 | static struct re_pattern_buffer zeropattern; | ||
| 5158 | char *name; | 5159 | char *name; |
| 5159 | const char *err; | 5160 | const char *err; |
| 5160 | struct re_pattern_buffer *patbuf; | 5161 | struct re_pattern_buffer *patbuf; |
| @@ -5175,11 +5176,9 @@ add_regex (regexp_pattern, ignore_case, lang) | |||
| 5175 | (void) scan_separators (name); | 5176 | (void) scan_separators (name); |
| 5176 | 5177 | ||
| 5177 | patbuf = xnew (1, struct re_pattern_buffer); | 5178 | patbuf = xnew (1, struct re_pattern_buffer); |
| 5178 | /* Translation table to fold case if appropriate. */ | 5179 | *patbuf = zeropattern; |
| 5179 | patbuf->translate = (ignore_case) ? lc_trans : NULL; | 5180 | if (ignore_case) |
| 5180 | patbuf->fastmap = NULL; | 5181 | patbuf->translate = lc_trans; /* translation table to fold case */ |
| 5181 | patbuf->buffer = NULL; | ||
| 5182 | patbuf->allocated = 0; | ||
| 5183 | 5182 | ||
| 5184 | err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); | 5183 | err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf); |
| 5185 | if (err != NULL) | 5184 | if (err != NULL) |