summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-10-24 14:50:07 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-24 14:50:07 +0100
commit3c5904d2a5d7861c227a4c3cd4ddcbc51014c838 (patch)
tree243eadeb0e139c863e41ffc2c968a0538351438a
parent844fb64a605d60131827503a001b2d1aa232b078 (diff)
downloadvim-git-3c5904d2a5d7861c227a4c3cd4ddcbc51014c838.tar.gz
patch 8.2.3561: cscope has a complicated way of giving an error messagev8.2.3561
Problem: Cscope has a complicated way of giving an error message. Solution: Use semsg(). (James McCoy, closes #9038)
-rw-r--r--src/if_cscope.c44
-rw-r--r--src/version.c2
2 files changed, 7 insertions, 39 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 7117a253f..d587587c4 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -462,17 +462,8 @@ cs_add(exarg_T *eap UNUSED)
static void
cs_stat_emsg(char *fname)
{
- char *stat_emsg = _("E563: stat(%s) error: %d");
- char *buf = alloc(strlen(stat_emsg) + MAXPATHL + 10);
-
- if (buf != NULL)
- {
- (void)sprintf(buf, stat_emsg, fname, errno);
- (void)emsg(buf);
- vim_free(buf);
- }
- else
- (void)emsg(_("E563: stat error"));
+ int err = errno;
+ (void)semsg(_("E563: stat(%s) error: %d"), fname, err);
}
@@ -1114,16 +1105,7 @@ cs_find_common(
// next symbol must be + or -
if (strchr(CSQF_FLAGS, *qfpos) == NULL)
{
- char *nf = _("E469: invalid cscopequickfix flag %c for %c");
- char *buf = alloc(strlen(nf));
-
- // strlen will be enough because we use chars
- if (buf != NULL)
- {
- sprintf(buf, nf, *qfpos, *(qfpos-1));
- (void)emsg(buf);
- vim_free(buf);
- }
+ (void)semsg(_("E469: invalid cscopequickfix flag %c for %c"), *qfpos, *(qfpos - 1));
return FALSE;
}
@@ -1177,24 +1159,8 @@ cs_find_common(
if (totmatches == 0)
{
- char *nf = _("E259: no matches found for cscope query %s of %s");
- char *buf;
-
- if (!verbose)
- {
- vim_free(nummatches);
- return FALSE;
- }
-
- buf = alloc(strlen(opt) + strlen(pat) + strlen(nf));
- if (buf == NULL)
- (void)emsg(nf);
- else
- {
- sprintf(buf, nf, opt, pat);
- (void)emsg(buf);
- vim_free(buf);
- }
+ if (verbose)
+ (void)semsg(_("E259: no matches found for cscope query %s of %s"), opt, pat);
vim_free(nummatches);
return FALSE;
}
diff --git a/src/version.c b/src/version.c
index a1714ebf9..7dc55ac95 100644
--- a/src/version.c
+++ b/src/version.c
@@ -758,6 +758,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3561,
+/**/
3560,
/**/
3559,