mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	ex_docmd: Fix PVS/V547: condition was already checked in surr. if()
This commit is contained in:
		@@ -5669,22 +5669,21 @@ static void do_ucmd(exarg_T *eap)
 | 
			
		||||
      if (start != NULL)
 | 
			
		||||
        end = vim_strchr(start + 1, '>');
 | 
			
		||||
      if (buf != NULL) {
 | 
			
		||||
        for (ksp = p; *ksp != NUL && *ksp != K_SPECIAL; ++ksp)
 | 
			
		||||
          ;
 | 
			
		||||
        for (ksp = p; *ksp != NUL && *ksp != K_SPECIAL; ksp++) {
 | 
			
		||||
        }
 | 
			
		||||
        if (*ksp == K_SPECIAL
 | 
			
		||||
            && (start == NULL || ksp < start || end == NULL)
 | 
			
		||||
            && ((ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)
 | 
			
		||||
                )) {
 | 
			
		||||
          /* K_SPECIAL has been put in the buffer as K_SPECIAL
 | 
			
		||||
          * KS_SPECIAL KE_FILLER, like for mappings, but
 | 
			
		||||
          * do_cmdline() doesn't handle that, so convert it back.
 | 
			
		||||
          * Also change K_SPECIAL KS_EXTRA KE_CSI into CSI. */
 | 
			
		||||
            && (ksp[1] == KS_SPECIAL && ksp[2] == KE_FILLER)) {
 | 
			
		||||
          // K_SPECIAL has been put in the buffer as K_SPECIAL
 | 
			
		||||
          // KS_SPECIAL KE_FILLER, like for mappings, but
 | 
			
		||||
          // do_cmdline() doesn't handle that, so convert it back.
 | 
			
		||||
          // Also change K_SPECIAL KS_EXTRA KE_CSI into CSI.
 | 
			
		||||
          len = ksp - p;
 | 
			
		||||
          if (len > 0) {
 | 
			
		||||
            memmove(q, p, len);
 | 
			
		||||
            q += len;
 | 
			
		||||
          }
 | 
			
		||||
          *q++ = ksp[1] == KS_SPECIAL ? K_SPECIAL : CSI;
 | 
			
		||||
          *q++ = K_SPECIAL;
 | 
			
		||||
          p = ksp + 3;
 | 
			
		||||
          continue;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user