comparison src/option.c @ 582:6a04259f5e0d

updated for version 7.0165
author vimboss
date Thu, 08 Dec 2005 22:02:51 +0000
parents 25a70b1cd2da
children d220eb88e4e4
comparison
equal deleted inserted replaced
581:ec04f19aed55 582:6a04259f5e0d
6528 static char_u * 6528 static char_u *
6529 compile_cap_prog(buf) 6529 compile_cap_prog(buf)
6530 buf_T *buf; 6530 buf_T *buf;
6531 { 6531 {
6532 regprog_T *rp = buf->b_cap_prog; 6532 regprog_T *rp = buf->b_cap_prog;
6533 char_u *re;
6533 6534
6534 if (*buf->b_p_spc == NUL) 6535 if (*buf->b_p_spc == NUL)
6535 {
6536 buf->b_cap_prog = NULL; 6536 buf->b_cap_prog = NULL;
6537 vim_free(rp); 6537 else
6538 return NULL; 6538 {
6539 } 6539 /* Prepend a ^ so that we only match at one column */
6540 6540 re = concat_str((char_u *)"^", buf->b_p_spc);
6541 /* Prepend a ^ so that we only match at one column */ 6541 if (re != NULL)
6542 vim_snprintf((char *)IObuff, IOSIZE, "^%s", buf->b_p_spc); 6542 {
6543 buf->b_cap_prog = vim_regcomp(IObuff, RE_MAGIC); 6543 buf->b_cap_prog = vim_regcomp(re, RE_MAGIC);
6544 if (buf->b_cap_prog == NULL) 6544 if (buf->b_cap_prog == NULL)
6545 { 6545 {
6546 buf->b_cap_prog = rp; 6546 buf->b_cap_prog = rp; /* restore the previous program */
6547 return e_invarg; 6547 return e_invarg;
6548 }
6549 vim_free(re);
6550 }
6548 } 6551 }
6549 6552
6550 vim_free(rp); 6553 vim_free(rp);
6551 return NULL; 6554 return NULL;
6552 } 6555 }