mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.1.0886: compiler warning for NULL pointer and condition always true
Problem: Compiler warning for adding to NULL pointer and a condition that is always true. Solution: Check for NULL pointer before adding. Remove useless "if". (Friedirch, closes #3913)
This commit is contained in:
@@ -291,16 +291,17 @@ findoldfile(char **destination)
|
|||||||
{
|
{
|
||||||
char *bp = *destination;
|
char *bp = *destination;
|
||||||
size_t indir_l = strlen(installdir);
|
size_t indir_l = strlen(installdir);
|
||||||
char *cp = bp + indir_l;
|
char *cp;
|
||||||
char *tmpname;
|
char *tmpname;
|
||||||
char *farname;
|
char *farname;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No action needed if exe not found or not in this directory.
|
* No action needed if exe not found or not in this directory.
|
||||||
*/
|
*/
|
||||||
if (bp == NULL
|
if (bp == NULL || strnicmp(bp, installdir, indir_l) != 0)
|
||||||
|| strnicmp(bp, installdir, indir_l) != 0
|
return;
|
||||||
|| strchr("/\\", *cp++) == NULL
|
cp = bp + indir_l;
|
||||||
|
if (strchr("/\\", *cp++) == NULL
|
||||||
|| strchr(cp, '\\') != NULL
|
|| strchr(cp, '\\') != NULL
|
||||||
|| strchr(cp, '/') != NULL)
|
|| strchr(cp, '/') != NULL)
|
||||||
return;
|
return;
|
||||||
|
18
src/search.c
18
src/search.c
@@ -4732,18 +4732,14 @@ current_search(
|
|||||||
VIsual_active = TRUE;
|
VIsual_active = TRUE;
|
||||||
VIsual_mode = 'v';
|
VIsual_mode = 'v';
|
||||||
|
|
||||||
if (VIsual_active)
|
redraw_curbuf_later(INVERTED); /* update the inversion */
|
||||||
|
if (*p_sel == 'e')
|
||||||
{
|
{
|
||||||
redraw_curbuf_later(INVERTED); /* update the inversion */
|
/* Correction for exclusive selection depends on the direction. */
|
||||||
if (*p_sel == 'e')
|
if (forward && LTOREQ_POS(VIsual, curwin->w_cursor))
|
||||||
{
|
inc_cursor();
|
||||||
/* Correction for exclusive selection depends on the direction. */
|
else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual))
|
||||||
if (forward && LTOREQ_POS(VIsual, curwin->w_cursor))
|
inc(&VIsual);
|
||||||
inc_cursor();
|
|
||||||
else if (!forward && LTOREQ_POS(curwin->w_cursor, VIsual))
|
|
||||||
inc(&VIsual);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef FEAT_FOLDING
|
#ifdef FEAT_FOLDING
|
||||||
|
@@ -783,6 +783,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
886,
|
||||||
/**/
|
/**/
|
||||||
885,
|
885,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user