summaryrefslogtreecommitdiffstats
path: root/src/tag.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tag.c')
-rw-r--r--src/tag.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tag.c b/src/tag.c
index 0822875967..fa8016269a 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -3547,14 +3547,20 @@ static int add_tag_field __ARGS((dict_T *dict, char *field_name, char_u *start,
add_tag_field(dict, field_name, start, end)
dict_T *dict;
char *field_name;
- char_u *start;
- char_u *end;
+ char_u *start; /* start of the value */
+ char_u *end; /* after the value; can be NULL */
{
char_u buf[MAXPATHL];
int len = 0;
if (start != NULL)
{
+ if (end == NULL)
+ {
+ end = start + STRLEN(start);
+ while (end > start && (end[-1] == '\r' || end[-1] == '\n'))
+ --end;
+ }
len = end - start;
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;