mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3561: cscope has a complicated way of giving an error message
Problem: Cscope has a complicated way of giving an error message.
Solution: Use semsg(). (James McCoy, closes vim/vim#9038)
3c5904d2a5
This commit is contained in:
parent
502ff11663
commit
9e479ea05e
@ -403,12 +403,8 @@ static int cs_add(exarg_T *eap)
|
|||||||
|
|
||||||
static void cs_stat_emsg(char *fname)
|
static void cs_stat_emsg(char *fname)
|
||||||
{
|
{
|
||||||
char *stat_emsg = _("E563: stat(%s) error: %d");
|
int err = errno;
|
||||||
char *buf = xmalloc(strlen(stat_emsg) + MAXPATHL + 10);
|
(void)semsg(_("E563: stat(%s) error: %d"), fname, err);
|
||||||
|
|
||||||
(void)sprintf(buf, stat_emsg, fname, errno);
|
|
||||||
(void)emsg(buf);
|
|
||||||
xfree(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -970,13 +966,7 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose, int us
|
|||||||
qfpos++;
|
qfpos++;
|
||||||
// next symbol must be + or -
|
// next symbol must be + or -
|
||||||
if (strchr(CSQF_FLAGS, *qfpos) == NULL) {
|
if (strchr(CSQF_FLAGS, *qfpos) == NULL) {
|
||||||
char *nf = _("E469: invalid cscopequickfix flag %c for %c");
|
(void)semsg(_("E469: invalid cscopequickfix flag %c for %c"), *qfpos, *(qfpos - 1));;
|
||||||
// strlen will be enough because we use chars
|
|
||||||
char *buf = xmalloc(strlen(nf));
|
|
||||||
|
|
||||||
sprintf(buf, nf, *qfpos, *(qfpos-1));
|
|
||||||
(void)emsg(buf);
|
|
||||||
xfree(buf);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1025,18 +1015,9 @@ static int cs_find_common(char *opt, char *pat, int forceit, int verbose, int us
|
|||||||
xfree(cmd);
|
xfree(cmd);
|
||||||
|
|
||||||
if (totmatches == 0) {
|
if (totmatches == 0) {
|
||||||
char *nf = _("E259: no matches found for cscope query %s of %s");
|
if (verbose) {
|
||||||
char *buf;
|
(void)semsg(_("E259: no matches found for cscope query %s of %s"), opt, pat);
|
||||||
|
|
||||||
if (!verbose) {
|
|
||||||
xfree(nummatches);
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buf = xmalloc(strlen(opt) + strlen(pat) + strlen(nf));
|
|
||||||
sprintf(buf, nf, opt, pat);
|
|
||||||
(void)emsg(buf);
|
|
||||||
xfree(buf);
|
|
||||||
xfree(nummatches);
|
xfree(nummatches);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user