Patch 9.0.1638 (after 9.0.1637)
Problem:    crypt tests hang and cause memory errors
Solution:   Move variable to start of function.
Files:      src/fileio.c


*** ../vim-9.0.1637/src/fileio.c        2023-06-16 21:42:02.380360392 +0100
--- src/fileio.c        2023-06-17 14:56:20.386925633 +0100
***************
*** 218,223 ****
--- 218,224 ----
      int               using_b_ffname;
      int               using_b_fname;
      static char *msg_is_a_directory = N_("is a directory");
+     int               eof = FALSE;
  #ifdef FEAT_SODIUM
      int               may_need_lseek = FALSE;
  #endif
***************
*** 1222,1228 ****
                    size -= conv_restlen;
                }
  
-               int eof = FALSE;
                if (read_buffer)
                {
                    /*
--- 1223,1228 ----
***************
*** 1306,1313 ****
                    {
                        // set size to 8K + Sodium Crypt Metadata
                        size = WRITEBUFSIZE + crypt_get_max_header_len()
!                    + crypto_secretstream_xchacha20poly1305_HEADERBYTES
!                    + crypto_secretstream_xchacha20poly1305_ABYTES;
                        may_need_lseek = TRUE;
                    }
  
--- 1306,1313 ----
                    {
                        // set size to 8K + Sodium Crypt Metadata
                        size = WRITEBUFSIZE + crypt_get_max_header_len()
!                           + crypto_secretstream_xchacha20poly1305_HEADERBYTES
!                               + crypto_secretstream_xchacha20poly1305_ABYTES;
                        may_need_lseek = TRUE;
                    }
  
***************
*** 1328,1338 ****
                        }
                    }
  # endif
!                   eof = size;
!                   size = read_eintr(fd, ptr, size);
                    filesize_count += size;
                    // hit end of file
!                   eof = (size < eof || filesize_count == filesize_disk);
                }
  
  #ifdef FEAT_CRYPT
--- 1328,1338 ----
                        }
                    }
  # endif
!                   long read_size = size;
!                   size = read_eintr(fd, ptr, read_size);
                    filesize_count += size;
                    // hit end of file
!                   eof = (size < read_size || filesize_count == filesize_disk);
                }
  
  #ifdef FEAT_CRYPT
*** ../vim-9.0.1637/src/version.c       2023-06-16 21:42:02.380360392 +0100
--- src/version.c       2023-06-17 14:53:56.447093657 +0100
***************
*** 697,698 ****
--- 697,700 ----
  {   /* Add new patch number below this line */
+ /**/
+     1638,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
188. You purchase a laptop so you can surf while sitting on the can.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230617140059.156481C1241%40moolenaar.net.

Raspunde prin e-mail lui