Mercurial > vim
comparison src/tag.c @ 211:79c3648993c3
updated for version 7.0060
author | vimboss |
---|---|
date | Wed, 16 Mar 2005 09:50:44 +0000 |
parents | 041a413d626d |
children | 4707450c2b33 |
comparison
equal
deleted
inserted
replaced
210:9fc6d9745d17 | 211:79c3648993c3 |
---|---|
3545 */ | 3545 */ |
3546 static int | 3546 static int |
3547 add_tag_field(dict, field_name, start, end) | 3547 add_tag_field(dict, field_name, start, end) |
3548 dict_T *dict; | 3548 dict_T *dict; |
3549 char *field_name; | 3549 char *field_name; |
3550 char_u *start; | 3550 char_u *start; /* start of the value */ |
3551 char_u *end; | 3551 char_u *end; /* after the value; can be NULL */ |
3552 { | 3552 { |
3553 char_u buf[MAXPATHL]; | 3553 char_u buf[MAXPATHL]; |
3554 int len = 0; | 3554 int len = 0; |
3555 | 3555 |
3556 if (start != NULL) | 3556 if (start != NULL) |
3557 { | 3557 { |
3558 if (end == NULL) | |
3559 { | |
3560 end = start + STRLEN(start); | |
3561 while (end > start && (end[-1] == '\r' || end[-1] == '\n')) | |
3562 --end; | |
3563 } | |
3558 len = end - start; | 3564 len = end - start; |
3559 if (len > sizeof(buf) - 1) | 3565 if (len > sizeof(buf) - 1) |
3560 len = sizeof(buf) - 1; | 3566 len = sizeof(buf) - 1; |
3561 STRNCPY(buf, start, len); | 3567 STRNCPY(buf, start, len); |
3562 } | 3568 } |