diff options
| author | Francesco Potortì | 2002-09-03 15:21:07 +0000 |
|---|---|---|
| committer | Francesco Potortì | 2002-09-03 15:21:07 +0000 |
| commit | a127d423b58e6b51d670891eb314bfa7bdc340ee (patch) | |
| tree | 8f5a2b2334866d3a4c98c2be7420df0602ded4d8 /lib-src | |
| parent | bda54be798251f954f19f8f16091ad6ee753be5e (diff) | |
| download | emacs-a127d423b58e6b51d670891eb314bfa7bdc340ee.tar.gz emacs-a127d423b58e6b51d670891eb314bfa7bdc340ee.zip | |
(regex_tag_multiline, readline): Never pass pfnote a
string that cannot be freed.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 5e5e9e9421f..c0518af6034 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | * | 35 | * |
| 36 | */ | 36 | */ |
| 37 | 37 | ||
| 38 | char pot_etags_version[] = "@(#) pot revision number is 16.54"; | 38 | char pot_etags_version[] = "@(#) pot revision number is $Revision: 16.55 $"; |
| 39 | 39 | ||
| 40 | #define TRUE 1 | 40 | #define TRUE 1 |
| 41 | #define FALSE 0 | 41 | #define FALSE 0 |
| @@ -1871,6 +1871,7 @@ pfnote (name, is_func, linestart, linelen, lno, cno) | |||
| 1871 | { | 1871 | { |
| 1872 | register node *np; | 1872 | register node *np; |
| 1873 | 1873 | ||
| 1874 | assert (name == NULL || name[0] != '\0'); | ||
| 1874 | if (CTAGS && name == NULL) | 1875 | if (CTAGS && name == NULL) |
| 1875 | return; | 1876 | return; |
| 1876 | 1877 | ||
| @@ -5727,6 +5728,7 @@ substitute (in, out, regs) | |||
| 5727 | size -= 1; | 5728 | size -= 1; |
| 5728 | 5729 | ||
| 5729 | /* Allocate space and do the substitutions. */ | 5730 | /* Allocate space and do the substitutions. */ |
| 5731 | assert (size >= 0); | ||
| 5730 | result = xnew (size + 1, char); | 5732 | result = xnew (size + 1, char); |
| 5731 | 5733 | ||
| 5732 | for (t = result; *out != '\0'; out++) | 5734 | for (t = result; *out != '\0'; out++) |
| @@ -5741,7 +5743,8 @@ substitute (in, out, regs) | |||
| 5741 | *t++ = *out; | 5743 | *t++ = *out; |
| 5742 | *t = '\0'; | 5744 | *t = '\0'; |
| 5743 | 5745 | ||
| 5744 | assert (t <= result + size && t - result == (int)strlen (result)); | 5746 | assert (t <= result + size); |
| 5747 | assert (t - result == (int)strlen (result)); | ||
| 5745 | 5748 | ||
| 5746 | return result; | 5749 | return result; |
| 5747 | } | 5750 | } |
| @@ -5828,8 +5831,9 @@ regex_tag_multiline () | |||
| 5828 | if (buffer[charno++] == '\n') | 5831 | if (buffer[charno++] == '\n') |
| 5829 | lineno++, linecharno = charno; | 5832 | lineno++, linecharno = charno; |
| 5830 | name = rp->name; | 5833 | name = rp->name; |
| 5831 | if (name[0] != '\0') | 5834 | if (name[0] == '\0') |
| 5832 | /* Make a named tag. */ | 5835 | name = NULL; |
| 5836 | else /* make a named tag */ | ||
| 5833 | name = substitute (buffer, rp->name, &rp->regs); | 5837 | name = substitute (buffer, rp->name, &rp->regs); |
| 5834 | if (rp->force_explicit_name) | 5838 | if (rp->force_explicit_name) |
| 5835 | /* Force explicit tag name, if a name is there. */ | 5839 | /* Force explicit tag name, if a name is there. */ |
| @@ -6151,8 +6155,9 @@ readline (lbp, stream) | |||
| 6151 | default: | 6155 | default: |
| 6152 | /* Match occurred. Construct a tag. */ | 6156 | /* Match occurred. Construct a tag. */ |
| 6153 | name = rp->name; | 6157 | name = rp->name; |
| 6154 | if (name[0] != '\0') | 6158 | if (name[0] == '\0') |
| 6155 | /* Make a named tag. */ | 6159 | name = NULL; |
| 6160 | else /* make a named tag */ | ||
| 6156 | name = substitute (lbp->buffer, rp->name, &rp->regs); | 6161 | name = substitute (lbp->buffer, rp->name, &rp->regs); |
| 6157 | if (rp->force_explicit_name) | 6162 | if (rp->force_explicit_name) |
| 6158 | /* Force explicit tag name, if a name is there. */ | 6163 | /* Force explicit tag name, if a name is there. */ |