1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: When running out of memory during startup trying to open a
12 swapfile will loop forever.
13 Solution: Let findswapname() set dirp to NULL if out of memory.
17 *** ../vim-7.3.348/src/memline.c 2011-06-13 01:07:22.000000000 +0200
18 --- src/memline.c 2011-10-26 11:26:06.000000000 +0200
23 fname = findswapname(buf, &dirp, mfp->mf_fname);
25 + if (dirp == NULL) /* out of memory */
27 if (fname == NULL) /* no file name found for this dir */
33 * and creating it, another Vim creates the file. In that case the
34 * creation will fail and we will use another directory. */
35 fname = findswapname(buf, &dirp, NULL); /* allocates fname */
37 + break; /* out of memory */
40 if (mf_open_file(mfp, fname) == OK) /* consumes fname! */
45 * Several names are tried to find one that does not exist
46 * Returns the name in allocated memory or NULL.
47 + * When out of memory "dirp" is set to NULL.
49 * Note: If BASENAMELEN is not correct, you will get error messages for
50 * not being able to open the swap or undo file
53 * First allocate some memory to put the directory name in.
55 dir_name = alloc((unsigned)STRLEN(*dirp) + 1);
56 ! if (dir_name != NULL)
57 (void)copy_option_part(dirp, dir_name, 31000, ",");
61 * First allocate some memory to put the directory name in.
63 dir_name = alloc((unsigned)STRLEN(*dirp) + 1);
64 ! if (dir_name == NULL)
67 (void)copy_option_part(dirp, dir_name, 31000, ",");
70 *** ../vim-7.3.348/src/version.c 2011-10-26 11:40:56.000000000 +0200
71 --- src/version.c 2011-10-26 11:43:05.000000000 +0200
75 { /* Add new patch number below this line */
82 ...for all the complaining I hear about the government
83 because it means we have freedom of speech.
85 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
86 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
87 \\\ an exciting new programming language -- http://www.Zimbu.org ///
88 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///