changeset 32611:a4b5a6a95005 v9.0.1637

patch 9.0.1637: compiler warning for uninitialized variable Commit: https://github.com/vim/vim/commit/54f50cbf6a470316a262e4389d62424e6f06b81c Author: Christian Brabandt <cb@256bit.org> Date: Fri Jun 16 21:42:06 2023 +0100 patch 9.0.1637: compiler warning for uninitialized variable Problem: Compiler warning for uninitialized variable. Solution: Move the variable to an inner block and initialize it. (Christian Brabandt, closes #12549)
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Jun 2023 22:45:04 +0200
parents 01f925835f39
children dea4d9e2a68e
files src/fileio.c src/version.c
diffstat 2 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -218,7 +218,6 @@ readfile(
     int		using_b_ffname;
     int		using_b_fname;
     static char *msg_is_a_directory = N_("is a directory");
-    int		eof;
 #ifdef FEAT_SODIUM
     int		may_need_lseek = FALSE;
 #endif
@@ -1223,13 +1222,13 @@ retry:
 		    size -= conv_restlen;
 		}
 
+		int eof = FALSE;
 		if (read_buffer)
 		{
 		    /*
 		     * Read bytes from curbuf.  Used for converting text read
 		     * from stdin.
 		     */
-		    eof = FALSE;
 		    if (read_buf_lnum > from)
 			size = 0;
 		    else
@@ -5477,7 +5476,7 @@ match_file_pat(
     int
 match_file_list(char_u *list, char_u *sfname, char_u *ffname)
 {
-    char_u	buf[100];
+    char_u	buf[MAXPATHL];
     char_u	*tail;
     char_u	*regpat;
     char	allow_dirs;
@@ -5490,7 +5489,7 @@ match_file_list(char_u *list, char_u *sf
     p = list;
     while (*p)
     {
-	copy_option_part(&p, buf, 100, ",");
+	copy_option_part(&p, buf, MAXPATHL, ",");
 	regpat = file_pat_to_reg_pat(buf, NULL, &allow_dirs, FALSE);
 	if (regpat == NULL)
 	    break;
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1637,
+/**/
     1636,
 /**/
     1635,