diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index bd4d4fcf53a..af142b0b3d1 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -5773,7 +5773,7 @@ static void | |||
| 5773 | TEX_decode_env (const char *evarname, const char *defenv) | 5773 | TEX_decode_env (const char *evarname, const char *defenv) |
| 5774 | { | 5774 | { |
| 5775 | const char *env, *p; | 5775 | const char *env, *p; |
| 5776 | ptrdiff_t len; | 5776 | ptrdiff_t len = 1; |
| 5777 | 5777 | ||
| 5778 | /* Append default string to environment. */ | 5778 | /* Append default string to environment. */ |
| 5779 | env = getenv (evarname); | 5779 | env = getenv (evarname); |
| @@ -5782,8 +5782,13 @@ TEX_decode_env (const char *evarname, const char *defenv) | |||
| 5782 | else | 5782 | else |
| 5783 | env = concat (env, defenv, ""); | 5783 | env = concat (env, defenv, ""); |
| 5784 | 5784 | ||
| 5785 | /* If the environment variable starts with a colon, increase the | ||
| 5786 | length of the token table. */ | ||
| 5787 | if (*env == ':') | ||
| 5788 | len++; | ||
| 5789 | |||
| 5785 | /* Allocate a token table */ | 5790 | /* Allocate a token table */ |
| 5786 | for (len = 1, p = env; (p = strchr (p, ':')); ) | 5791 | for (p = env; (p = strchr (p, ':')); ) |
| 5787 | if (*++p) | 5792 | if (*++p) |
| 5788 | len++; | 5793 | len++; |
| 5789 | TEX_toktab = xnew (len, linebuffer); | 5794 | TEX_toktab = xnew (len, linebuffer); |