Skip to content

Commit 9baf297

Browse files
committed
patch 7.4.2239
Problem: Warning for missing declaration of skip_vimgrep_pat(). (John Marriott) Solution: Move it to another file.
1 parent de7762a commit 9baf297

5 files changed

Lines changed: 58 additions & 56 deletions

File tree

src/ex_cmds.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8392,6 +8392,60 @@ ex_drop(exarg_T *eap)
83928392
}
83938393
#endif
83948394

8395+
#if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO)
8396+
/*
8397+
* Skip over the pattern argument of ":vimgrep /pat/[g][j]".
8398+
* Put the start of the pattern in "*s", unless "s" is NULL.
8399+
* If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
8400+
* If "s" is not NULL terminate the pattern with a NUL.
8401+
* Return a pointer to the char just past the pattern plus flags.
8402+
*/
8403+
char_u *
8404+
skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
8405+
{
8406+
int c;
8407+
8408+
if (vim_isIDc(*p))
8409+
{
8410+
/* ":vimgrep pattern fname" */
8411+
if (s != NULL)
8412+
*s = p;
8413+
p = skiptowhite(p);
8414+
if (s != NULL && *p != NUL)
8415+
*p++ = NUL;
8416+
}
8417+
else
8418+
{
8419+
/* ":vimgrep /pattern/[g][j] fname" */
8420+
if (s != NULL)
8421+
*s = p + 1;
8422+
c = *p;
8423+
p = skip_regexp(p + 1, c, TRUE, NULL);
8424+
if (*p != c)
8425+
return NULL;
8426+
8427+
/* Truncate the pattern. */
8428+
if (s != NULL)
8429+
*p = NUL;
8430+
++p;
8431+
8432+
/* Find the flags */
8433+
while (*p == 'g' || *p == 'j')
8434+
{
8435+
if (flags != NULL)
8436+
{
8437+
if (*p == 'g')
8438+
*flags |= VGR_GLOBAL;
8439+
else
8440+
*flags |= VGR_NOJUMP;
8441+
}
8442+
++p;
8443+
}
8444+
}
8445+
return p;
8446+
}
8447+
#endif
8448+
83958449
#if defined(FEAT_EVAL) || defined(PROTO)
83968450
/*
83978451
* List v:oldfiles in a nice way.

src/proto/ex_cmds.pro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ char_u *get_sign_name(expand_T *xp, int idx);
6565
void set_context_in_sign_cmd(expand_T *xp, char_u *arg);
6666
void ex_smile(exarg_T *eap);
6767
void ex_drop(exarg_T *eap);
68+
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
6869
void ex_oldfiles(exarg_T *eap);
6970
/* vim: set ft=c : */

src/proto/quickfix.pro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ void ex_cc(exarg_T *eap);
2626
void ex_cnext(exarg_T *eap);
2727
void ex_cfile(exarg_T *eap);
2828
void ex_vimgrep(exarg_T *eap);
29-
char_u *skip_vimgrep_pat(char_u *p, char_u **s, int *flags);
30-
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
3129
int get_errorlist(win_T *wp, int qf_idx, list_T *list);
30+
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
3231
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what);
3332
void ex_cbuffer(exarg_T *eap);
3433
void ex_cexpr(exarg_T *eap);

src/quickfix.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -5155,57 +5155,3 @@ ex_helpgrep(exarg_T *eap)
51555155
}
51565156

51575157
#endif /* FEAT_QUICKFIX */
5158-
5159-
#if defined(FEAT_QUICKFIX) || defined(FEAT_EVAL) || defined(PROTO)
5160-
/*
5161-
* Skip over the pattern argument of ":vimgrep /pat/[g][j]".
5162-
* Put the start of the pattern in "*s", unless "s" is NULL.
5163-
* If "flags" is not NULL put the flags in it: VGR_GLOBAL, VGR_NOJUMP.
5164-
* If "s" is not NULL terminate the pattern with a NUL.
5165-
* Return a pointer to the char just past the pattern plus flags.
5166-
*/
5167-
char_u *
5168-
skip_vimgrep_pat(char_u *p, char_u **s, int *flags)
5169-
{
5170-
int c;
5171-
5172-
if (vim_isIDc(*p))
5173-
{
5174-
/* ":vimgrep pattern fname" */
5175-
if (s != NULL)
5176-
*s = p;
5177-
p = skiptowhite(p);
5178-
if (s != NULL && *p != NUL)
5179-
*p++ = NUL;
5180-
}
5181-
else
5182-
{
5183-
/* ":vimgrep /pattern/[g][j] fname" */
5184-
if (s != NULL)
5185-
*s = p + 1;
5186-
c = *p;
5187-
p = skip_regexp(p + 1, c, TRUE, NULL);
5188-
if (*p != c)
5189-
return NULL;
5190-
5191-
/* Truncate the pattern. */
5192-
if (s != NULL)
5193-
*p = NUL;
5194-
++p;
5195-
5196-
/* Find the flags */
5197-
while (*p == 'g' || *p == 'j')
5198-
{
5199-
if (flags != NULL)
5200-
{
5201-
if (*p == 'g')
5202-
*flags |= VGR_GLOBAL;
5203-
else
5204-
*flags |= VGR_NOJUMP;
5205-
}
5206-
++p;
5207-
}
5208-
}
5209-
return p;
5210-
}
5211-
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2239,
766768
/**/
767769
2238,
768770
/**/

0 commit comments

Comments
 (0)