Mercurial > vim
comparison src/quickfix.c @ 9334:674f9e3ccd1a v7.4.1949
commit https://github.com/vim/vim/commit/38df43bd13a2498cc96b3ddd9a20dd75126bd171
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Jun 20 21:41:12 2016 +0200
patch 7.4.1949
Problem: Minor problems with the quickfix code.
Solution: Fix the problems. (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 20 Jun 2016 21:45:06 +0200 |
parents | 692e156c7023 |
children | 3830a92c12bf |
comparison
equal
deleted
inserted
replaced
9333:df1a801dff77 | 9334:674f9e3ccd1a |
---|---|
621 { | 621 { |
622 /* Get the next line from the supplied buffer */ | 622 /* Get the next line from the supplied buffer */ |
623 if (buflnum > lnumlast) | 623 if (buflnum > lnumlast) |
624 break; | 624 break; |
625 p_buf = ml_get_buf(buf, buflnum++, FALSE); | 625 p_buf = ml_get_buf(buf, buflnum++, FALSE); |
626 linelen = (int)STRLEN(p_buf); | 626 len = (int)STRLEN(p_buf); |
627 if (linelen > IOSIZE - 2) | 627 if (len > IOSIZE - 2) |
628 { | 628 { |
629 linebuf = qf_grow_linebuf(&growbuf, &growbufsiz, len, | 629 linebuf = qf_grow_linebuf(&growbuf, &growbufsiz, len, |
630 &linelen); | 630 &linelen); |
631 if (linebuf == NULL) | 631 if (linebuf == NULL) |
632 goto qf_init_end; | 632 goto qf_init_end; |
633 } | 633 } |
634 else | 634 else |
635 { | |
635 linebuf = IObuff; | 636 linebuf = IObuff; |
637 linelen = len; | |
638 } | |
636 vim_strncpy(linebuf, p_buf, linelen); | 639 vim_strncpy(linebuf, p_buf, linelen); |
637 } | 640 } |
638 } | 641 } |
639 else | 642 else |
640 { | 643 { |
1433 buf->b_has_qf_entry = TRUE; | 1436 buf->b_has_qf_entry = TRUE; |
1434 return buf->b_fnum; | 1437 return buf->b_fnum; |
1435 } | 1438 } |
1436 | 1439 |
1437 /* | 1440 /* |
1438 * push dirbuf onto the directory stack and return pointer to actual dir or | 1441 * Push dirbuf onto the directory stack and return pointer to actual dir or |
1439 * NULL on error | 1442 * NULL on error. |
1440 */ | 1443 */ |
1441 static char_u * | 1444 static char_u * |
1442 qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr) | 1445 qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr) |
1443 { | 1446 { |
1444 struct dir_stack_T *ds_new; | 1447 struct dir_stack_T *ds_new; |