diff options
Diffstat (limited to 'src/cindent.c')
-rw-r--r-- | src/cindent.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/cindent.c b/src/cindent.c index a22db9560e..268d274aec 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -425,32 +425,35 @@ cin_islabel_skip(char_u **s) static int cin_isscopedecl(char_u *p) { - size_t cinsd_len; - char_u *cinsd_buf; - char_u *cinsd; - size_t len; - char_u *skip; - char_u *s = cin_skipcomment(p); + size_t cinsd_len; + char_u *cinsd_buf; + char_u *cinsd; + size_t len; + char_u *skip; + char_u *s = cin_skipcomment(p); + int found = FALSE; cinsd_len = STRLEN(curbuf->b_p_cinsd) + 1; cinsd_buf = alloc(cinsd_len); - if (cinsd_buf != NULL) + if (cinsd_buf == NULL) + return FALSE; + + for (cinsd = curbuf->b_p_cinsd; *cinsd; ) { - for (cinsd = curbuf->b_p_cinsd; *cinsd; ) + len = copy_option_part(&cinsd, cinsd_buf, cinsd_len, ","); + if (STRNCMP(s, cinsd_buf, len) == 0) { - len = copy_option_part(&cinsd, cinsd_buf, cinsd_len, ","); - if (STRNCMP(s, cinsd_buf, len) == 0) + skip = cin_skipcomment(s + len); + if (*skip == ':' && skip[1] != ':') { - skip = cin_skipcomment(s + len); - if (*skip == ':' && skip[1] != ':') - return TRUE; + found = TRUE; + break; } } - - vim_free(cinsd_buf); } - return FALSE; + vim_free(cinsd_buf); + return found; } /* |