diff --git a/stable-patches/buffer.c.patch b/stable-patches/buffer.c.patch index 158f2cf..dd54cf5 100644 --- a/stable-patches/buffer.c.patch +++ b/stable-patches/buffer.c.patch @@ -1,7 +1,7 @@ -diff --git i/src/buffer.c w/src/buffer.c -index 748ffda..391bd32 100644 ---- i/src/buffer.c -+++ w/src/buffer.c +diff --git a/src/buffer.c b/src/buffer.c +index 26e3ec969..0600b33a0 100644 +--- a/src/buffer.c ++++ b/src/buffer.c @@ -26,6 +26,9 @@ */ @@ -12,7 +12,7 @@ index 748ffda..391bd32 100644 #ifdef FEAT_EVAL -@@ -2156,6 +2159,11 @@ buflist_new( +@@ -2175,6 +2178,11 @@ buflist_new( { char_u *ffname = ffname_arg; char_u *sfname = sfname_arg; @@ -24,7 +24,7 @@ index 748ffda..391bd32 100644 buf_T *buf; #ifdef UNIX stat_T st; -@@ -2164,6 +2172,70 @@ buflist_new( +@@ -2183,6 +2191,70 @@ buflist_new( if (top_file_num == 1) hash_init(&buf_hashtab); @@ -62,16 +62,16 @@ index 748ffda..391bd32 100644 + reclen = dsfile->reclen; + isdataset = TRUE; + -+ // Create a temporary file to represent the dataset -+ ffname = vim_tempname('z', TRUE); -+ -+ // Map dataset to file path ++ // Map dataset to a deterministic file path to enable swap file protection + char file_suffix[PATH_MAX]; + char newpath[PATH_MAX]; ++ char *user = getenv("USER"); ++ if (user == NULL) user = "default"; ++ + map_to_unixfile(dsfile, file_suffix); -+ snprintf(newpath, PATH_MAX, "%s-%s", ffname, file_suffix); ++ snprintf(newpath, PATH_MAX, "/tmp/%s-%s", user, file_suffix); + -+ // Set ffname and sfname to temporary ++ // Set ffname and sfname to the deterministic path + sfname = vim_strsave(newpath); + ffname = sfname; + @@ -95,7 +95,7 @@ index 748ffda..391bd32 100644 fname_expand(curbuf, &ffname, &sfname); // will allocate ffname /* -@@ -2262,9 +2334,10 @@ buflist_new( +@@ -2281,9 +2353,10 @@ buflist_new( if (ffname != NULL) { @@ -108,7 +108,7 @@ index 748ffda..391bd32 100644 clear_wininfo(buf); buf->b_wininfo = ALLOC_CLEAR_ONE(wininfo_T); -@@ -2311,6 +2384,7 @@ buflist_new( +@@ -2330,6 +2403,7 @@ buflist_new( } lastbuf = buf; @@ -116,7 +116,7 @@ index 748ffda..391bd32 100644 if ((flags & BLN_REUSE) && buf_reuse.ga_len > 0) { // Recycle a previously used buffer number. Used for buffers which -@@ -2365,6 +2439,13 @@ buflist_new( +@@ -2384,6 +2458,13 @@ buflist_new( #endif buf->b_fname = buf->b_sfname;